home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libghttp.idb / usr / freeware / src / libghttp / patches.z / patches
Encoding:
Text File  |  1999-07-16  |  223.2 KB  |  6,798 lines

  1. --- ./ltmain.sh    Tue May 25 10:29:26 1999
  2. +++ ../libghttp-1.0.4/./ltmain.sh    Sat Jul  3 23:08:26 1999
  3. @@ -1,8 +1,8 @@
  4.  # ltmain.sh - Provide generalized library-building support services.
  5.  # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  6.  #
  7. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  8. -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  9. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  10. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  11.  #
  12.  # This program is free software; you can redistribute it and/or modify
  13.  # it under the terms of the GNU General Public License as published by
  14. @@ -28,12 +28,8 @@
  15.    # Discard the --no-reexec flag, and continue.
  16.    shift
  17.  elif test "X$1" = X--fallback-echo; then
  18. -  # used as fallback echo
  19. -  shift
  20. -  cat <<EOF
  21. -$*
  22. -EOF
  23. -  exit 0
  24. +  # Avoid inline document here, it may be left over
  25. +  :
  26.  elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  27.    # Yippee, $echo works!
  28.    :
  29. @@ -42,6 +38,15 @@
  30.    exec $SHELL "$0" --no-reexec ${1+"$@"}
  31.  fi
  32.  
  33. +if test "X$1" = X--fallback-echo; then
  34. +  # used as fallback echo
  35. +  shift
  36. +  cat <<EOF
  37. +$*
  38. +EOF
  39. +  exit 0
  40. +fi
  41. +
  42.  # The name of this program.
  43.  progname=`$echo "$0" | sed 's%^.*/%%'`
  44.  modename="$progname"
  45. @@ -49,7 +54,8 @@
  46.  # Constants.
  47.  PROGRAM=ltmain.sh
  48.  PACKAGE=libtool
  49. -VERSION=1.2d
  50. +VERSION=1.3.2
  51. +TIMESTAMP=" (1.385.2.150 1999/05/26 00:28:32)"
  52.  
  53.  default_mode=
  54.  help="Try \`$progname --help' for more information."
  55. @@ -60,8 +66,10 @@
  56.  
  57.  # Sed substitution that helps us do robust quoting.  It backslashifies
  58.  # metacharacters that are still active within double-quoted strings.
  59. -Xsed='sed -e s/^X//'
  60. +Xsed='sed -e 1s/^X//'
  61.  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  62. +SP2NL='tr \040 \012'
  63. +NL2SP='tr \012 \040'
  64.  
  65.  # NLS nuisances.
  66.  # Only set LANG and LC_ALL to C if already set.
  67. @@ -97,7 +105,7 @@
  68.  show_help=
  69.  execute_dlfiles=
  70.  lo2o="s/\\.lo\$/.${objext}/"
  71. -los2o="s/\\.lo /.${objext} /g"
  72. +o2lo="s/\\.${objext}\$/.lo/"
  73.  
  74.  # Parse our command line options once, thoroughly.
  75.  while test $# -gt 0
  76. @@ -133,7 +141,7 @@
  77.      ;;
  78.  
  79.    --version)
  80. -    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
  81. +    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  82.      exit 0
  83.      ;;
  84.  
  85. @@ -208,12 +216,12 @@
  86.        mode=link
  87.        for arg
  88.        do
  89. -        case "$arg" in
  90. -        -c)
  91. -           mode=compile
  92. -           break
  93. -           ;;
  94. -        esac
  95. +    case "$arg" in
  96. +    -c)
  97. +       mode=compile
  98. +       break
  99. +       ;;
  100. +    esac
  101.        done
  102.        ;;
  103.      *db | *dbx | *strace | *truss)
  104. @@ -231,11 +239,11 @@
  105.  
  106.        # Just use the default operation mode.
  107.        if test -z "$mode"; then
  108. -        if test -n "$nonopt"; then
  109. -          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  110. -        else
  111. -          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  112. -        fi
  113. +    if test -n "$nonopt"; then
  114. +      $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  115. +    else
  116. +      $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  117. +    fi
  118.        fi
  119.        ;;
  120.      esac
  121. @@ -262,7 +270,6 @@
  122.      lastarg=
  123.      srcfile="$nonopt"
  124.      suppress_output=
  125. -    force_static=no
  126.  
  127.      user_target=no
  128.      for arg
  129. @@ -270,36 +277,31 @@
  130.        # Accept any command-line options.
  131.        case "$arg" in
  132.        -o)
  133. -        if test "$user_target" != "no"; then
  134. -          $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  135. +    if test "$user_target" != "no"; then
  136. +      $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  137.        exit 1
  138. -        fi
  139. -        user_target=next
  140. +    fi
  141. +    user_target=next
  142.      ;;
  143.  
  144. -      -force-static)
  145. -        force_static=yes
  146. -        continue
  147. -        ;;
  148. -    
  149.        -static)
  150. -        build_old_libs=yes
  151. -        continue
  152. -        ;;
  153. +    build_old_libs=yes
  154. +    continue
  155. +    ;;
  156.        esac
  157.  
  158.        case "$user_target" in
  159.        next)
  160. -        # The next one is the -o target name
  161. -        user_target=yes
  162. -        continue
  163. -        ;;
  164. +    # The next one is the -o target name
  165. +    user_target=yes
  166. +    continue
  167. +    ;;
  168.        yes)
  169. -        # We got the output file
  170. -        user_target=set
  171. -        libobj="$arg"
  172. -        continue
  173. -        ;;
  174. +    # We got the output file
  175. +    user_target=set
  176. +    libobj="$arg"
  177. +    continue
  178. +    ;;
  179.        esac
  180.  
  181.        # Accept the current argument as the source file.
  182. @@ -318,15 +320,15 @@
  183.        # sets, so we specify it separately.
  184.        case "$lastarg" in
  185.        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  186. -        lastarg="\"$lastarg\""
  187. -        ;;
  188. +    lastarg="\"$lastarg\""
  189. +    ;;
  190.        esac
  191.  
  192.        # Add the previous argument to base_compile.
  193.        if test -z "$base_compile"; then
  194. -        base_compile="$lastarg"
  195. +    base_compile="$lastarg"
  196.        else
  197. -        base_compile="$base_compile $lastarg"
  198. +    base_compile="$base_compile $lastarg"
  199.        fi
  200.      done
  201.  
  202. @@ -377,9 +379,9 @@
  203.  
  204.      # Delete any leftover library objects.
  205.      if test "$build_old_libs" = yes; then
  206. -      removelist="$obj $libobj $lockfile"
  207. +      removelist="$obj $libobj"
  208.      else
  209. -      removelist="$libobj $lockfile"
  210. +      removelist="$libobj"
  211.      fi
  212.  
  213.      $run $rm $removelist
  214. @@ -401,8 +403,8 @@
  215.      # We use this script file to make the link, it avoids creating a new file
  216.      if test "$need_locks" = yes; then
  217.        until ln "$0" "$lockfile" 2>/dev/null; do
  218. -        $show "Waiting for $lockfile to be removed"
  219. -        sleep 2
  220. +    $show "Waiting for $lockfile to be removed"
  221. +    sleep 2
  222.        done
  223.      elif test "$need_locks" = warn; then
  224.        if test -f "$lockfile"; then
  225. @@ -433,20 +435,43 @@
  226.        fbsd_hideous_sh_bug=$base_compile
  227.  
  228.        # All platforms use -DPIC, to notify preprocessed assembler code.
  229. -      command="$base_compile$pic_flag -DPIC $srcfile"
  230. +      command="$base_compile $pic_flag -DPIC $srcfile"
  231. +      if test "$build_old_libs" = yes; then
  232. +    lo_libobj="$libobj"
  233. +    dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  234. +    if test "X$dir" = "X$libobj"; then
  235. +      dir="$objdir"
  236. +    else
  237. +      dir="$dir/$objdir"
  238. +    fi
  239. +    libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  240. +
  241. +    if test -d "$dir"; then
  242. +      $show "$rm $libobj"
  243. +      $run $rm $libobj
  244. +    else
  245. +      $show "$mkdir $dir"
  246. +      $run $mkdir $dir
  247. +      status=$?
  248. +      if test $status -ne 0 && test ! -d $dir; then
  249. +        exit $status
  250. +      fi
  251. +    fi
  252. +      fi
  253.        if test "$compiler_o_lo" = yes; then
  254. -        command="$command -o $libobj"
  255. -        output_obj="$libobj"
  256. +    output_obj="$libobj"
  257. +    command="$command -o $output_obj"
  258.        elif test "$compiler_c_o" = yes; then
  259. -        command="$command -o $obj"
  260. -        output_obj="$obj"
  261. +    output_obj="$obj"
  262. +    command="$command -o $output_obj"
  263.        fi
  264.  
  265. +      $run $rm "$output_obj"
  266.        $show "$command"
  267.        if $run eval "$command"; then :
  268.        else
  269. -        test -n "$output_obj" && $run $rm $removelist
  270. -        exit 1
  271. +    test -n "$output_obj" && $run $rm $removelist
  272. +    exit 1
  273.        fi
  274.  
  275.        if test "$need_locks" = warn &&
  276. @@ -470,9 +495,9 @@
  277.        fi
  278.  
  279.        # Just move the object if needed, then go on to compile the next one
  280. -      if test "$compiler_o_lo" = no && test x"$output_obj" != x"$libobj"; then
  281. -        $show "$mv $output_obj $libobj"
  282. -        if $run $mv $output_obj $libobj; then :
  283. +      if test x"$output_obj" != x"$libobj"; then
  284. +    $show "$mv $output_obj $libobj"
  285. +    if $run $mv $output_obj $libobj; then :
  286.      else
  287.        error=$?
  288.        $run $rm $removelist
  289. @@ -480,14 +505,28 @@
  290.      fi
  291.        fi
  292.  
  293. -      # If we have no pic_flag and do not have -force-static, 
  294. -      # then copy the object into place and finish.
  295. -      if test -z "$pic_flag" && test "$force_static" = no; then
  296. -        $show "$LN_S $libobj $obj"
  297. -        if $run $LN_S $libobj $obj; then
  298. +      # If we have no pic_flag, then copy the object into place and finish.
  299. +      if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  300. +    # Rename the .lo from within objdir to obj
  301. +    if test -f $obj; then
  302. +      $show $rm $obj
  303. +      $run $rm $obj
  304. +    fi
  305. +
  306. +    $show "$mv $libobj $obj"
  307. +    if $run $mv $libobj $obj; then :
  308. +    else
  309. +      error=$?
  310. +      $run $rm $removelist
  311. +      exit $error
  312. +    fi
  313. +
  314. +    # Now arrange that obj and lo_libobj become the same file
  315. +    $show "$LN_S $obj $lo_libobj"
  316. +    if $run $LN_S $obj $lo_libobj; then
  317.        exit 0
  318.      else
  319. -          error=$?
  320. +      error=$?
  321.        $run $rm $removelist
  322.        exit $error
  323.      fi
  324. @@ -500,21 +539,19 @@
  325.      # Only build a position-dependent object if we build old libraries.
  326.      if test "$build_old_libs" = yes; then
  327.        command="$base_compile $srcfile"
  328. -      if test "$force_static" = yes; then
  329. -        command="$command -DLIBTOOL_STATIC"
  330. -      fi
  331.        if test "$compiler_c_o" = yes; then
  332. -        command="$command -o $obj"
  333. -        output_obj="$obj"
  334. +    command="$command -o $obj"
  335. +    output_obj="$obj"
  336.        fi
  337.  
  338.        # Suppress compiler output if we already did a PIC compilation.
  339.        command="$command$suppress_output"
  340. +      $run $rm "$output_obj"
  341.        $show "$command"
  342.        if $run eval "$command"; then :
  343.        else
  344. -        $run $rm $removelist
  345. -        exit 1
  346. +    $run $rm $removelist
  347. +    exit 1
  348.        fi
  349.  
  350.        if test "$need_locks" = warn &&
  351. @@ -538,9 +575,25 @@
  352.        fi
  353.  
  354.        # Just move the object if needed
  355. -      if test "$compiler_c_o" = no && test x"$output_obj" != x"$obj"; then
  356. -        $show "$mv $output_obj $obj"
  357. -        if $run $mv $output_obj $obj; then :
  358. +      if test x"$output_obj" != x"$obj"; then
  359. +    $show "$mv $output_obj $obj"
  360. +    if $run $mv $output_obj $obj; then :
  361. +    else
  362. +      error=$?
  363. +      $run $rm $removelist
  364. +      exit $error
  365. +    fi
  366. +      fi
  367. +
  368. +      # Create an invalid libtool object if no PIC, so that we do not
  369. +      # accidentally link it into a program.
  370. +      if test "$build_libtool_libs" != yes; then
  371. +    $show "echo timestamp > $libobj"
  372. +    $run eval "echo timestamp > \$libobj" || exit $?
  373. +      else
  374. +    # Move the .lo from within objdir
  375. +    $show "$mv $libobj $lo_libobj"
  376. +    if $run $mv $libobj $lo_libobj; then :
  377.      else
  378.        error=$?
  379.        $run $rm $removelist
  380. @@ -554,13 +607,6 @@
  381.        $rm "$lockfile"
  382.      fi
  383.  
  384. -    # Create an invalid libtool object if no PIC, so that we do not
  385. -    # accidentally link it into a program.
  386. -    if test "$build_libtool_libs" != yes; then
  387. -      $show "echo timestamp > $libobj"
  388. -      $run eval "echo timestamp > \$libobj" || exit $?
  389. -    fi
  390. -
  391.      exit 0
  392.      ;;
  393.  
  394. @@ -569,34 +615,230 @@
  395.      modename="$modename: link"
  396.      C_compiler="$CC" # save it, to compile generated C sources
  397.      CC="$nonopt"
  398. -    allow_undefined=yes
  399. +    case "$host" in
  400. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  401. +      # It is impossible to link a dll without this setting, and
  402. +      # we shouldn't force the makefile maintainer to figure out
  403. +      # which system we are compiling for in order to pass an extra
  404. +      # flag for every libtool invokation.
  405. +      # allow_undefined=no
  406. +
  407. +      # FIXME: Unfortunately, there are problems with the above when trying
  408. +      # to make a dll which has undefined symbols, in which case not
  409. +      # even a static library is built.  For now, we need to specify
  410. +      # -no-undefined on the libtool link line when we can be certain
  411. +      # that all symbols are satisfied, otherwise we get a static library.
  412. +      allow_undefined=yes
  413. +
  414. +      # This is a source program that is used to create dlls on Windows
  415. +      # Don't remove nor modify the starting and closing comments
  416. +# /* ltdll.c starts here */
  417. +# #define WIN32_LEAN_AND_MEAN
  418. +# #include <windows.h>
  419. +# #undef WIN32_LEAN_AND_MEAN
  420. +# #include <stdio.h>
  421. +#
  422. +# #ifdef __cplusplus
  423. +# extern "C" {
  424. +# #endif
  425. +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  426. +# #ifdef __cplusplus
  427. +# }
  428. +# #endif
  429. +#
  430. +# #include <cygwin/cygwin_dll.h>
  431. +# DECLARE_CYGWIN_DLL( DllMain );
  432. +# HINSTANCE __hDllInstance_base;
  433. +#
  434. +# BOOL APIENTRY
  435. +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  436. +# {
  437. +#   __hDllInstance_base = hInst;
  438. +#   return TRUE;
  439. +# }
  440. +# /* ltdll.c ends here */
  441. +      # This is a source program that is used to create import libraries
  442. +      # on Windows for dlls which lack them. Don't remove nor modify the
  443. +      # starting and closing comments
  444. +# /* impgen.c starts here */
  445. +# /*   Copyright (C) 1999 Free Software Foundation, Inc.
  446. +# 
  447. +#  This file is part of GNU libtool.
  448. +# 
  449. +#  This program is free software; you can redistribute it and/or modify
  450. +#  it under the terms of the GNU General Public License as published by
  451. +#  the Free Software Foundation; either version 2 of the License, or
  452. +#  (at your option) any later version.
  453. +# 
  454. +#  This program is distributed in the hope that it will be useful,
  455. +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  456. +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  457. +#  GNU General Public License for more details.
  458. +# 
  459. +#  You should have received a copy of the GNU General Public License
  460. +#  along with this program; if not, write to the Free Software
  461. +#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  462. +#  */
  463. +# 
  464. +#  #include <stdio.h>        /* for printf() */
  465. +#  #include <unistd.h>        /* for open(), lseek(), read() */
  466. +#  #include <fcntl.h>        /* for O_RDONLY, O_BINARY */
  467. +#  #include <string.h>        /* for strdup() */
  468. +# 
  469. +#  static unsigned int
  470. +#  pe_get16 (fd, offset)
  471. +#       int fd;
  472. +#       int offset;
  473. +#  {
  474. +#    unsigned char b[2];
  475. +#    lseek (fd, offset, SEEK_SET);
  476. +#    read (fd, b, 2);
  477. +#    return b[0] + (b[1]<<8);
  478. +#  }
  479. +# 
  480. +#  static unsigned int
  481. +#  pe_get32 (fd, offset)
  482. +#      int fd;
  483. +#      int offset;
  484. +#  {
  485. +#    unsigned char b[4];
  486. +#    lseek (fd, offset, SEEK_SET);
  487. +#    read (fd, b, 4);
  488. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  489. +#  }
  490. +# 
  491. +#  static unsigned int
  492. +#  pe_as32 (ptr)
  493. +#       void *ptr;
  494. +#  {
  495. +#    unsigned char *b = ptr;
  496. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  497. +#  }
  498. +# 
  499. +#  int
  500. +#  main (argc, argv)
  501. +#      int argc;
  502. +#      char *argv[];
  503. +#  {
  504. +#      int dll;
  505. +#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  506. +#      unsigned long export_rva, export_size, nsections, secptr, expptr;
  507. +#      unsigned long name_rvas, nexp;
  508. +#      unsigned char *expdata, *erva;
  509. +#      char *filename, *dll_name;
  510. +# 
  511. +#      filename = argv[1];
  512. +# 
  513. +#      dll = open(filename, O_RDONLY|O_BINARY);
  514. +#      if (!dll)
  515. +#      return 1;
  516. +# 
  517. +#      dll_name = filename;
  518. +#    
  519. +#      for (i=0; filename[i]; i++)
  520. +#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
  521. +#          dll_name = filename + i +1;
  522. +# 
  523. +#      pe_header_offset = pe_get32 (dll, 0x3c);
  524. +#      opthdr_ofs = pe_header_offset + 4 + 20;
  525. +#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
  526. +# 
  527. +#      if (num_entries < 1) /* no exports */
  528. +#      return 1;
  529. +# 
  530. +#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
  531. +#      export_size = pe_get32 (dll, opthdr_ofs + 100);
  532. +#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  533. +#      secptr = (pe_header_offset + 4 + 20 +
  534. +#            pe_get16 (dll, pe_header_offset + 4 + 16));
  535. +# 
  536. +#      expptr = 0;
  537. +#      for (i = 0; i < nsections; i++)
  538. +#      {
  539. +#      char sname[8];
  540. +#      unsigned long secptr1 = secptr + 40 * i;
  541. +#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  542. +#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  543. +#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  544. +#      lseek(dll, secptr1, SEEK_SET);
  545. +#      read(dll, sname, 8);
  546. +#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
  547. +#      {
  548. +#          expptr = fptr + (export_rva - vaddr);
  549. +#          if (export_rva + export_size > vaddr + vsize)
  550. +#          export_size = vsize - (export_rva - vaddr);
  551. +#          break;
  552. +#      }
  553. +#      }
  554. +# 
  555. +#      expdata = (unsigned char*)malloc(export_size);
  556. +#      lseek (dll, expptr, SEEK_SET);
  557. +#      read (dll, expdata, export_size);
  558. +#      erva = expdata - export_rva;
  559. +# 
  560. +#      nexp = pe_as32 (expdata+24);
  561. +#      name_rvas = pe_as32 (expdata+32);
  562. +# 
  563. +#      printf ("EXPORTS\n");
  564. +#      for (i = 0; i<nexp; i++)
  565. +#      {
  566. +#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  567. +#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  568. +#      }
  569. +# 
  570. +#      return 0;
  571. +#  }
  572. +# /* impgen.c ends here */
  573. +      ;;
  574. +    *)
  575. +      allow_undefined=yes
  576. +      ;;
  577. +    esac
  578.      compile_command="$CC"
  579.      finalize_command="$CC"
  580.  
  581. +    compile_rpath=
  582. +    finalize_rpath=
  583.      compile_shlibpath=
  584.      finalize_shlibpath=
  585.      convenience=
  586.      old_convenience=
  587.      deplibs=
  588. -    eval lib_search_path=\"$sys_lib_search_path\"
  589. +    linkopts=
  590. +
  591. +    if test -n "$shlibpath_var"; then
  592. +      # get the directories listed in $shlibpath_var
  593. +      eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  594. +    else
  595. +      lib_search_path=
  596. +    fi
  597. +    # now prepend the system-specific ones
  598. +    eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  599. +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  600.      
  601. +    avoid_version=no
  602.      dlfiles=
  603.      dlprefiles=
  604. +    dlself=no
  605.      export_dynamic=no
  606.      export_symbols=
  607. +    export_symbols_regex=
  608.      generated=
  609. -    hardcode_libdirs=
  610.      libobjs=
  611.      link_against_libtool_libs=
  612.      ltlibs=
  613.      module=no
  614.      objs=
  615. +    prefer_static_libs=no
  616. +    preload=no
  617.      prev=
  618.      prevarg=
  619.      release=
  620.      rpath=
  621. +    xrpath=
  622.      perm_rpath=
  623.      temp_rpath=
  624. +    thread_safe=no
  625.      vinfo=
  626.  
  627.      # We need to know -static, to get the right output filenames.
  628. @@ -604,13 +846,23 @@
  629.      do
  630.        case "$arg" in
  631.        -all-static | -static)
  632. -        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  633. +    if test "X$arg" = "X-all-static"; then
  634. +      if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  635.          $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  636. -        fi
  637. -        build_libtool_libs=no
  638. +      fi
  639. +      if test -n "$link_static_flag"; then
  640. +        dlopen_self=$dlopen_self_static
  641. +      fi
  642. +    else
  643. +      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  644. +        dlopen_self=$dlopen_self_static
  645. +      fi
  646. +    fi
  647. +    build_libtool_libs=no
  648.      build_old_libs=yes
  649. -        break
  650. -        ;;
  651. +    prefer_static_libs=yes
  652. +    break
  653. +    ;;
  654.        esac
  655.      done
  656.  
  657. @@ -624,31 +876,58 @@
  658.  
  659.        # If the previous option needs an argument, assign it.
  660.        if test -n "$prev"; then
  661. -        case "$prev" in
  662. -        output)
  663. -          compile_command="$compile_command @OUTPUT@"
  664. -          finalize_command="$finalize_command @OUTPUT@"
  665. -          ;;
  666. -        esac
  667. -
  668. -        case "$prev" in
  669. -        dlfiles|dlprefiles)
  670. -          case "$arg" in
  671. -          *.la | *.lo) ;;  # We handle these cases below.
  672. -          *)
  673. -            dlprefiles="$dlprefiles $arg"
  674. -            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  675. -            prev=
  676. -            ;;
  677. -          esac
  678. -          ;;
  679. -    exportsyms)
  680. +    case "$prev" in
  681. +    output)
  682. +      compile_command="$compile_command @OUTPUT@"
  683. +      finalize_command="$finalize_command @OUTPUT@"
  684. +      ;;
  685. +    esac
  686. +
  687. +    case "$prev" in
  688. +    dlfiles|dlprefiles)
  689. +      if test "$preload" = no; then
  690. +        # Add the symbol object into the linking commands.
  691. +        compile_command="$compile_command @SYMFILE@"
  692. +        finalize_command="$finalize_command @SYMFILE@"
  693. +        preload=yes
  694. +      fi
  695. +      case "$arg" in
  696. +      *.la | *.lo) ;;  # We handle these cases below.
  697. +      self)
  698. +        if test "$prev" = dlprefiles; then
  699. +          dlself=yes
  700. +        elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  701. +          dlself=yes
  702. +        else
  703. +          dlself=needless
  704. +          export_dynamic=yes
  705. +        fi
  706. +        prev=
  707. +        continue
  708. +        ;;
  709. +      *)
  710. +        if test "$prev" = dlfiles; then
  711. +          dlfiles="$dlfiles $arg"
  712. +        else
  713. +          dlprefiles="$dlprefiles $arg"
  714. +        fi
  715. +        prev=
  716. +        ;;
  717. +      esac
  718. +      ;;
  719. +    expsyms)
  720.        export_symbols="$arg"
  721. -          if test ! -f "$arg"; then
  722. -            $echo "$modename: symbol file \`$arg' does not exist"
  723. -            exit 1
  724. -          fi
  725. +      if test ! -f "$arg"; then
  726. +        $echo "$modename: symbol file \`$arg' does not exist"
  727. +        exit 1
  728. +      fi
  729.        prev=
  730. +      continue
  731. +      ;;
  732. +    expsyms_regex)
  733. +      export_symbols_regex="$arg"
  734. +      prev=
  735. +      continue
  736.        ;;
  737.      release)
  738.        release="-$arg"
  739. @@ -655,17 +934,35 @@
  740.        prev=
  741.        continue
  742.        ;;
  743. -        rpath)
  744. -          rpath="$rpath $arg"
  745. +    rpath | xrpath)
  746. +      # We need an absolute path.
  747. +      case "$arg" in
  748. +      [\\/]* | [A-Za-z]:[\\/]*) ;;
  749. +      *)
  750. +        $echo "$modename: only absolute run-paths are allowed" 1>&2
  751. +        exit 1
  752. +        ;;
  753. +      esac
  754. +      if test "$prev" = rpath; then
  755. +        case "$rpath " in
  756. +        *" $arg "*) ;;
  757. +        *) rpath="$rpath $arg" ;;
  758. +        esac
  759. +      else
  760. +        case "$xrpath " in
  761. +        *" $arg "*) ;;
  762. +        *) xrpath="$xrpath $arg" ;;
  763. +        esac
  764. +      fi
  765. +      prev=
  766. +      continue
  767. +      ;;
  768. +    *)
  769. +      eval "$prev=\"\$arg\""
  770.        prev=
  771.        continue
  772.        ;;
  773. -        *)
  774. -          eval "$prev=\"\$arg\""
  775. -          prev=
  776. -          continue
  777. -          ;;
  778. -        esac
  779. +    esac
  780.        fi
  781.  
  782.        prevarg="$arg"
  783. @@ -673,10 +970,10 @@
  784.        case "$arg" in
  785.        -all-static)
  786.      if test -n "$link_static_flag"; then
  787. -          compile_command="$compile_command $link_static_flag"
  788. +      compile_command="$compile_command $link_static_flag"
  789.        finalize_command="$finalize_command $link_static_flag"
  790. -        fi
  791. -        continue
  792. +    fi
  793. +    continue
  794.      ;;
  795.  
  796.        -allow-undefined)
  797. @@ -685,68 +982,98 @@
  798.      continue
  799.      ;;
  800.  
  801. +      -avoid-version)
  802. +    avoid_version=yes
  803. +    continue
  804. +    ;;
  805. +
  806.        -dlopen)
  807. -        prev=dlfiles
  808. -        continue
  809. -        ;;
  810. +    prev=dlfiles
  811. +    continue
  812. +    ;;
  813.  
  814.        -dlpreopen)
  815. -        prev=dlprefiles
  816. -        continue
  817. -        ;;
  818. +    prev=dlprefiles
  819. +    continue
  820. +    ;;
  821.  
  822.        -export-dynamic)
  823. -        if test "$export_dynamic" != yes; then
  824. -          export_dynamic=yes
  825. -      if test -n "$export_dynamic_flag_spec"; then
  826. -        eval arg=\"$export_dynamic_flag_spec\"
  827. -      else
  828. -        arg=
  829. -      fi
  830. +    export_dynamic=yes
  831. +    continue
  832. +    ;;
  833.  
  834. -          # Add the symbol object into the linking commands.
  835. -      compile_command="$compile_command @SYMFILE@"
  836. -      finalize_command="$finalize_command @SYMFILE@"
  837. -        fi
  838. -        ;;
  839. -
  840. -      -export-symbols)
  841. -        if test -n "$export_symbols"; then
  842. -          $echo "$modename: cannot have more than one -exported-symbols"
  843. -          exit 1
  844. -        fi
  845. -    prev=exportsyms
  846. +      -export-symbols | -export-symbols-regex)
  847. +    if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  848. +      $echo "$modename: not more than one -exported-symbols argument allowed"
  849. +      exit 1
  850. +    fi
  851. +    if test "X$arg" = "X-export-symbols"; then
  852. +      prev=expsyms
  853. +    else
  854. +      prev=expsyms_regex
  855. +    fi
  856.      continue
  857. -        ;;
  858. +    ;;
  859.  
  860.        -L*)
  861. -        dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
  862. -        case "$dir" in
  863. -        /* | [A-Za-z]:[/\\]*)
  864. -      # Add the corresponding hardcode_libdir_flag, if it is not identical.
  865. -          ;;
  866. -        *)
  867. -          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
  868. -          exit 1
  869. -          ;;
  870. -        esac
  871. -        deplibs="$deplibs $arg"
  872. -        lib_search_path="$lib_search_path `expr $arg : '-L\(.*\)'`"
  873. -        ;;
  874. +    dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  875. +    # We need an absolute path.
  876. +    case "$dir" in
  877. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  878. +    *)
  879. +      absdir=`cd "$dir" && pwd`
  880. +      if test -z "$absdir"; then
  881. +        $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  882. +        $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  883. +        absdir="$dir"
  884. +      fi
  885. +      dir="$absdir"
  886. +      ;;
  887. +    esac
  888. +    case " $deplibs " in
  889. +    *" $arg "*) ;;
  890. +    *) deplibs="$deplibs $arg";;
  891. +    esac
  892. +    case " $lib_search_path " in
  893. +    *" $dir "*) ;;
  894. +    *) lib_search_path="$lib_search_path $dir";;
  895. +    esac
  896. +    case "$host" in
  897. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  898. +      dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  899. +      case ":$dllsearchpath:" in
  900. +      ::) dllsearchpath="$dllsearchdir";;
  901. +      *":$dllsearchdir:"*) ;;
  902. +      *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  903. +      esac
  904. +      ;;
  905. +    esac
  906. +    ;;
  907.  
  908. -      -l*) deplibs="$deplibs $arg" ;;
  909. +      -l*)
  910. +    if test "$arg" = "-lc"; then
  911. +      case "$host" in
  912. +      *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  913. +        # These systems don't actually have c library (as such)
  914. +        continue
  915. +        ;;
  916. +      esac
  917. +    elif test "$arg" = "-lm"; then
  918. +      case "$host" in
  919. +      *-*-cygwin* | *-*-beos*)
  920. +        # These systems don't actually have math library (as such)
  921. +        continue
  922. +        ;;
  923. +      esac
  924. +    fi
  925. +    deplibs="$deplibs $arg"
  926. +    ;;
  927.  
  928.        -module)
  929. -        if test "$module" != yes; then
  930. -          module=yes
  931. -      if test -n "$export_dynamic_flag_spec"; then
  932. -        eval arg=\"$export_dynamic_flag_spec\"
  933. -      else
  934. -        arg=
  935. -      fi
  936. -    fi
  937. -        ;;
  938. -    
  939. +    module=yes
  940. +    continue
  941. +    ;;
  942. +
  943.        -no-undefined)
  944.      allow_undefined=no
  945.      continue
  946. @@ -760,23 +1087,50 @@
  947.      ;;
  948.  
  949.        -rpath)
  950. -        prev=rpath
  951. -        continue
  952. -        ;;
  953. +    prev=rpath
  954. +    continue
  955. +    ;;
  956. +
  957. +      -R)
  958. +    prev=xrpath
  959. +    continue
  960. +    ;;
  961. +
  962. +      -R*)
  963. +    dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  964. +    # We need an absolute path.
  965. +    case "$dir" in
  966. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  967. +    *)
  968. +      $echo "$modename: only absolute run-paths are allowed" 1>&2
  969. +      exit 1
  970. +      ;;
  971. +    esac
  972. +    case "$xrpath " in
  973. +    *" $dir "*) ;;
  974. +    *) xrpath="$xrpath $dir" ;;
  975. +    esac
  976. +    continue
  977. +    ;;
  978.  
  979.        -static)
  980.      # If we have no pic_flag, then this is the same as -all-static.
  981.      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  982. -          compile_command="$compile_command $link_static_flag"
  983. +      compile_command="$compile_command $link_static_flag"
  984.        finalize_command="$finalize_command $link_static_flag"
  985. -        fi
  986. +    fi
  987. +    continue
  988. +    ;;
  989. +
  990. +      -thread-safe)
  991. +    thread_safe=yes
  992.      continue
  993.      ;;
  994.  
  995.        -version-info)
  996. -        prev=vinfo
  997. -        continue
  998. -        ;;
  999. +    prev=vinfo
  1000. +    continue
  1001. +    ;;
  1002.  
  1003.        # Some other compiler flag.
  1004.        -* | +*)
  1005. @@ -788,18 +1142,18 @@
  1006.        arg="\"$arg\""
  1007.        ;;
  1008.      esac
  1009. -        ;;
  1010. +    ;;
  1011.  
  1012.        *.o | *.obj | *.a | *.lib)
  1013. -        # A standard object.
  1014. -        objs="$objs $arg"
  1015. -        ;;
  1016. +    # A standard object.
  1017. +    objs="$objs $arg"
  1018. +    ;;
  1019.  
  1020.        *.lo)
  1021. -        # A library object.
  1022. +    # A library object.
  1023.      if test "$prev" = dlfiles; then
  1024.        dlfiles="$dlfiles $arg"
  1025. -      if test "$build_libtool_libs" = yes; then
  1026. +      if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1027.          prev=
  1028.          continue
  1029.        else
  1030. @@ -814,46 +1168,47 @@
  1031.        prev=
  1032.      fi
  1033.      libobjs="$libobjs $arg"
  1034. -        ;;
  1035. +    ;;
  1036.  
  1037.        *.la)
  1038. -        # A libtool-controlled library.
  1039. +    # A libtool-controlled library.
  1040.  
  1041. -        dlname=
  1042. -        libdir=
  1043. -        library_names=
  1044. -        old_library=
  1045. -
  1046. -        # Check to see that this really is a libtool archive.
  1047. -        if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1048. -        else
  1049. -          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1050. -          exit 1
  1051. -        fi
  1052. +    dlname=
  1053. +    libdir=
  1054. +    library_names=
  1055. +    old_library=
  1056. +
  1057. +    # Check to see that this really is a libtool archive.
  1058. +    if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1059. +    else
  1060. +      $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1061. +      exit 1
  1062. +    fi
  1063.  
  1064.      # If the library was installed with an old release of libtool,
  1065.      # it will not redefine variable installed.
  1066.      installed=yes
  1067.  
  1068. -        # If there is no directory component, then add one.
  1069. -        case "$arg" in
  1070. -        */* | *\\*) . $arg ;;
  1071. -        *) . ./$arg ;;
  1072. -        esac
  1073. -
  1074. -        # Get the name of the library we link against.
  1075. -        linklib=
  1076. -        for l in $old_library $library_names; do
  1077. -          linklib="$l"
  1078. -        done
  1079. -
  1080. -        if test -z "$linklib"; then
  1081. -          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1082. -          exit 1
  1083. -        fi
  1084. +    # Read the .la file
  1085. +    # If there is no directory component, then add one.
  1086. +    case "$arg" in
  1087. +    */* | *\\*) . $arg ;;
  1088. +    *) . ./$arg ;;
  1089. +    esac
  1090. +
  1091. +    # Get the name of the library we link against.
  1092. +    linklib=
  1093. +    for l in $old_library $library_names; do
  1094. +      linklib="$l"
  1095. +    done
  1096. +
  1097. +    if test -z "$linklib"; then
  1098. +      $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1099. +      exit 1
  1100. +    fi
  1101.  
  1102. -        # Find the relevant object directory and library name.
  1103. -        name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1104. +    # Find the relevant object directory and library name.
  1105. +    name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1106.  
  1107.      if test "X$installed" = Xyes; then
  1108.        dir="$libdir"
  1109. @@ -866,7 +1221,27 @@
  1110.        fi
  1111.      fi
  1112.  
  1113. -        if test -z "$libdir"; then
  1114. +    if test -n "$dependency_libs"; then
  1115. +      # Extract -R from dependency_libs
  1116. +      temp_deplibs=
  1117. +      for deplib in $dependency_libs; do
  1118. +        case "$deplib" in
  1119. +        -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1120. +         case " $rpath $xrpath " in
  1121. +         *" $temp_xrpath "*) ;;
  1122. +         *) xrpath="$xrpath $temp_xrpath";;
  1123. +         esac;;
  1124. +        -L*) case "$compile_command $temp_deplibs " in
  1125. +         *" $deplib "*) ;;
  1126. +         *) temp_deplibs="$temp_deplibs $deplib";;
  1127. +         esac;;
  1128. +        *) temp_deplibs="$temp_deplibs $deplib";;
  1129. +        esac
  1130. +      done
  1131. +      dependency_libs="$temp_deplibs"
  1132. +    fi
  1133. +
  1134. +    if test -z "$libdir"; then
  1135.        # It is a libtool convenience library, so add in its objects.
  1136.        convenience="$convenience $dir/$old_library"
  1137.        old_convenience="$old_convenience $dir/$old_library"
  1138. @@ -876,130 +1251,149 @@
  1139.        continue
  1140.      fi
  1141.  
  1142. -        # This library was specified with -dlopen.
  1143. -        if test "$prev" = dlfiles; then
  1144. -          dlfiles="$dlfiles $arg"
  1145. -          if test -z "$dlname" || test "$build_libtool_libs" = no; then
  1146. -            # If there is no dlname or we're linking statically,
  1147. -            # we need to preload.
  1148. -            prev=dlprefiles
  1149. -          else
  1150. -            # We should not create a dependency on this library, but we
  1151. +    # This library was specified with -dlopen.
  1152. +    if test "$prev" = dlfiles; then
  1153. +      dlfiles="$dlfiles $arg"
  1154. +      if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1155. +        # If there is no dlname, no dlopen support or we're linking statically,
  1156. +        # we need to preload.
  1157. +        prev=dlprefiles
  1158. +      else
  1159. +        # We should not create a dependency on this library, but we
  1160.          # may need any libraries it requires.
  1161.          compile_command="$compile_command$dependency_libs"
  1162.          finalize_command="$finalize_command$dependency_libs"
  1163. -            prev=
  1164. -            continue
  1165. -          fi
  1166. -        fi
  1167. -
  1168. -        # The library was specified with -dlpreopen.
  1169. -        if test "$prev" = dlprefiles; then
  1170. -          # Prefer using a static library (so that no silly _DYNAMIC symbols
  1171. -          # are required to link).
  1172. -          if test -n "$old_library"; then
  1173. -            dlprefiles="$dlprefiles $dir/$old_library"
  1174. -          else
  1175. -            dlprefiles="$dlprefiles $dir/$linklib"
  1176. -          fi
  1177. -          prev=
  1178. -        fi
  1179. -
  1180. -        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
  1181. -          link_against_libtool_libs="$link_against_libtool_libs $arg"
  1182. -          if test -n "$shlibpath_var"; then
  1183. -            # Make sure the rpath contains only unique directories.
  1184. -            case "$temp_rpath " in
  1185. -            *" $dir "*) ;;
  1186. -            *) temp_rpath="$temp_rpath $dir" ;;
  1187. -            esac
  1188. -          fi
  1189. +        prev=
  1190. +        continue
  1191. +      fi
  1192. +    fi
  1193.  
  1194. +    # The library was specified with -dlpreopen.
  1195. +    if test "$prev" = dlprefiles; then
  1196. +      # Prefer using a static library (so that no silly _DYNAMIC symbols
  1197. +      # are required to link).
  1198. +      if test -n "$old_library"; then
  1199. +        dlprefiles="$dlprefiles $dir/$old_library"
  1200. +      else
  1201. +        dlprefiles="$dlprefiles $dir/$linklib"
  1202. +      fi
  1203. +      prev=
  1204. +    fi
  1205. +
  1206. +    if test -n "$library_names" &&
  1207. +       { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1208. +      link_against_libtool_libs="$link_against_libtool_libs $arg"
  1209. +      if test -n "$shlibpath_var"; then
  1210. +        # Make sure the rpath contains only unique directories.
  1211. +        case "$temp_rpath " in
  1212. +        *" $dir "*) ;;
  1213. +        *) temp_rpath="$temp_rpath $dir" ;;
  1214. +        esac
  1215. +      fi
  1216. +
  1217. +      # We need an absolute path.
  1218. +      case "$dir" in
  1219. +      [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1220. +      *)
  1221. +        absdir=`cd "$dir" && pwd`
  1222. +        if test -z "$absdir"; then
  1223. +          $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1224. +          $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1225. +          absdir="$dir"
  1226. +        fi
  1227. +        ;;
  1228. +      esac
  1229. +      
  1230.        # This is the magic to use -rpath.
  1231. -          if test -n "$hardcode_libdir_flag_spec"; then
  1232. -            if test -n "$hardcode_libdir_separator"; then
  1233. -              if test -z "$hardcode_libdirs"; then
  1234. -                # Put the magic libdir with the hardcode flag.
  1235. -                hardcode_libdirs="$libdir"
  1236. -                libdir="@HARDCODE_LIBDIRS@"
  1237. -              else
  1238. -                # Just accumulate the unique libdirs.
  1239. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  1240. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1241. -          ;;
  1242. -        *)
  1243. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1244. -          ;;
  1245. -        esac
  1246. -                libdir=
  1247. -              fi
  1248. -            fi
  1249. -
  1250. -            if test -n "$libdir"; then
  1251. -              eval flag=\"$hardcode_libdir_flag_spec\"
  1252. -
  1253. -              compile_command="$compile_command $flag"
  1254. -              finalize_command="$finalize_command $flag"
  1255. -            fi
  1256. -          elif test -n "$runpath_var"; then
  1257. -            # Do the same for the permanent run path.
  1258. -            case "$perm_rpath " in
  1259. -            *" $libdir "*) ;;
  1260. -            *) perm_rpath="$perm_rpath $libdir" ;;
  1261. -            esac
  1262. -          fi
  1263. +      # Skip directories that are in the system default run-time
  1264. +      # search path, unless they have been requested with -R.
  1265. +      case " $sys_lib_dlsearch_path " in
  1266. +      *" $absdir "*) ;;
  1267. +      *)
  1268. +        case "$compile_rpath " in
  1269. +        *" $absdir "*) ;;
  1270. +        *) compile_rpath="$compile_rpath $absdir" 
  1271. +        esac
  1272. +        ;;
  1273. +      esac
  1274.  
  1275. +      case " $sys_lib_dlsearch_path " in
  1276. +      *" $libdir "*) ;;
  1277. +      *)
  1278. +        case "$finalize_rpath " in
  1279. +        *" $libdir "*) ;;
  1280. +        *) finalize_rpath="$finalize_rpath $libdir"
  1281. +        esac
  1282. +        ;;
  1283. +      esac
  1284.  
  1285.        lib_linked=yes
  1286. -          case "$hardcode_action" in
  1287. -          immediate | unsupported)
  1288. -            if test "$hardcode_direct" = no; then
  1289. -              compile_command="$compile_command $dir/$linklib"
  1290. -            elif test "$hardcode_minus_L" = no; then
  1291. +      case "$hardcode_action" in
  1292. +      immediate | unsupported)
  1293. +        if test "$hardcode_direct" = no; then
  1294. +          compile_command="$compile_command $dir/$linklib"
  1295. +          deplibs="$deplibs $dir/$linklib"
  1296. +          case "$host" in
  1297. +          *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1298. +        dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1299. +        if test -n "$dllsearchpath"; then
  1300. +          dllsearchpath="$dllsearchpath:$dllsearchdir"
  1301. +        else
  1302. +          dllsearchpath="$dllsearchdir"
  1303. +        fi
  1304. +        ;;
  1305. +          esac
  1306. +        elif test "$hardcode_minus_L" = no; then
  1307.            case "$host" in
  1308.            *-*-sunos*)
  1309. -                compile_shlibpath="$compile_shlibpath$dir:"
  1310. +        compile_shlibpath="$compile_shlibpath$dir:"
  1311.          ;;
  1312.            esac
  1313. -              compile_command="$compile_command -L$dir -l$name"
  1314. -            elif test "$hardcode_shlibpath_var" = no; then
  1315. -              compile_shlibpath="$compile_shlibpath$dir:"
  1316. -              compile_command="$compile_command -l$name"
  1317. +          case "$compile_command " in
  1318. +          *" -L$dir "*) ;;
  1319. +          *) compile_command="$compile_command -L$dir";;
  1320. +          esac
  1321. +          compile_command="$compile_command -l$name"
  1322. +          deplibs="$deplibs -L$dir -l$name"
  1323. +        elif test "$hardcode_shlibpath_var" = no; then
  1324. +          case ":$compile_shlibpath:" in
  1325. +          *":$dir:"*) ;;
  1326. +          *) compile_shlibpath="$compile_shlibpath$dir:";;
  1327. +          esac
  1328. +          compile_command="$compile_command -l$name"
  1329. +          deplibs="$deplibs -l$name"
  1330.          else
  1331.            lib_linked=no
  1332. -            fi
  1333. -            ;;
  1334. +        fi
  1335. +        ;;
  1336.  
  1337. -          relink)
  1338. -            # We need an absolute path.
  1339. -            case "$dir" in
  1340. -            /* | [A-Za-z]:[/\\]*) ;;
  1341. -            *)
  1342. -              absdir=`cd "$dir" && pwd`
  1343. -              if test -z "$absdir"; then
  1344. -                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1345. -                exit 1
  1346. -              fi
  1347. -              dir="$absdir"
  1348. -              ;;
  1349. -            esac
  1350. -
  1351. -            if test "$hardcode_direct" = yes; then
  1352. -              compile_command="$compile_command $dir/$linklib"
  1353. -            elif test "$hardcode_minus_L" = yes; then
  1354. -              compile_command="$compile_command -L$dir -l$name"
  1355. -            elif test "$hardcode_shlibpath_var" = yes; then
  1356. -              compile_shlibpath="$compile_shlibpath$dir:"
  1357. -              compile_command="$compile_command -l$name"
  1358. +      relink)
  1359. +        if test "$hardcode_direct" = yes; then
  1360. +          compile_command="$compile_command $absdir/$linklib"
  1361. +          deplibs="$deplibs $absdir/$linklib"
  1362. +        elif test "$hardcode_minus_L" = yes; then
  1363. +          case "$compile_command " in
  1364. +          *" -L$absdir "*) ;;
  1365. +          *) compile_command="$compile_command -L$absdir";;
  1366. +          esac
  1367. +          compile_command="$compile_command -l$name"
  1368. +          deplibs="$deplibs -L$absdir -l$name"
  1369. +        elif test "$hardcode_shlibpath_var" = yes; then
  1370. +          case ":$compile_shlibpath:" in
  1371. +          *":$absdir:"*) ;;
  1372. +          *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1373. +          esac
  1374. +          compile_command="$compile_command -l$name"
  1375. +          deplibs="$deplibs -l$name"
  1376.          else
  1377.            lib_linked=no
  1378. -            fi
  1379. -            ;;
  1380. +        fi
  1381. +        ;;
  1382.  
  1383.        *)
  1384.          lib_linked=no
  1385.          ;;
  1386. -          esac
  1387. +      esac
  1388.  
  1389.        if test "$lib_linked" != yes; then
  1390.          $echo "$modename: configuration error: unsupported hardcode properties"
  1391. @@ -1006,24 +1400,35 @@
  1392.          exit 1
  1393.        fi
  1394.  
  1395. -          # Finalize command for both is simple: just hardcode it.
  1396. -          if test "$hardcode_direct" = yes; then
  1397. -            finalize_command="$finalize_command $libdir/$linklib"
  1398. -          elif test "$hardcode_minus_L" = yes; then
  1399. -            finalize_command="$finalize_command -L$libdir -l$name"
  1400. -          elif test "$hardcode_shlibpath_var" = yes; then
  1401. -            finalize_shlibpath="$finalize_shlibpath$libdir:"
  1402. -            finalize_command="$finalize_command -l$name"
  1403. -          else
  1404. -            # We cannot seem to hardcode it, guess we'll fake it.
  1405. -            finalize_command="$finalize_command -L$libdir -l$name"
  1406. -          fi
  1407. -        else
  1408. -          # Transform directly to old archives if we don't build new libraries.
  1409. -          if test -n "$pic_flag" && test -z "$old_library"; then
  1410. -            $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1411. -            exit 1
  1412. -          fi
  1413. +      # Finalize command for both is simple: just hardcode it.
  1414. +      if test "$hardcode_direct" = yes; then
  1415. +        finalize_command="$finalize_command $libdir/$linklib"
  1416. +      elif test "$hardcode_minus_L" = yes; then
  1417. +        case "$finalize_command " in
  1418. +        *" -L$libdir "*) ;;
  1419. +        *) finalize_command="$finalize_command -L$libdir";;
  1420. +        esac
  1421. +        finalize_command="$finalize_command -l$name"
  1422. +      elif test "$hardcode_shlibpath_var" = yes; then
  1423. +        case ":$finalize_shlibpath:" in
  1424. +        *":$libdir:"*) ;;
  1425. +        *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1426. +        esac
  1427. +        finalize_command="$finalize_command -l$name"
  1428. +      else
  1429. +        # We cannot seem to hardcode it, guess we'll fake it.
  1430. +        case "$finalize_command " in
  1431. +        *" -L$dir "*) ;;
  1432. +        *) finalize_command="$finalize_command -L$libdir";;
  1433. +        esac
  1434. +        finalize_command="$finalize_command -l$name"
  1435. +      fi
  1436. +    else
  1437. +      # Transform directly to old archives if we don't build new libraries.
  1438. +      if test -n "$pic_flag" && test -z "$old_library"; then
  1439. +        $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1440. +        exit 1
  1441. +      fi
  1442.  
  1443.        # Here we assume that one of hardcode_direct or hardcode_minus_L
  1444.        # is not unsupported.  This is valid on all known static and
  1445. @@ -1033,16 +1438,24 @@
  1446.          compile_command="$compile_command $dir/$linklib"
  1447.          finalize_command="$finalize_command $dir/$linklib"
  1448.        else
  1449. -        compile_command="$compile_command -L$dir -l$name"
  1450. -        finalize_command="$finalize_command -L$dir -l$name"
  1451. +        case "$compile_command " in
  1452. +        *" -L$dir "*) ;;
  1453. +        *) compile_command="$compile_command -L$dir";;
  1454. +        esac
  1455. +        compile_command="$compile_command -l$name"
  1456. +        case "$finalize_command " in
  1457. +        *" -L$dir "*) ;;
  1458. +        *) finalize_command="$finalize_command -L$dir";;
  1459. +        esac
  1460. +        finalize_command="$finalize_command -l$name"
  1461.        fi
  1462. -        fi
  1463. +    fi
  1464.  
  1465.      # Add in any libraries that this one depends upon.
  1466.      compile_command="$compile_command$dependency_libs"
  1467.      finalize_command="$finalize_command$dependency_libs"
  1468.      continue
  1469. -        ;;
  1470. +    ;;
  1471.  
  1472.        # Some other compiler argument.
  1473.        *)
  1474. @@ -1054,7 +1467,7 @@
  1475.        arg="\"$arg\""
  1476.        ;;
  1477.      esac
  1478. -        ;;
  1479. +    ;;
  1480.        esac
  1481.  
  1482.        # Now actually substitute the argument into the commands.
  1483. @@ -1070,14 +1483,16 @@
  1484.        exit 1
  1485.      fi
  1486.  
  1487. -    if test -n "$export_symbols" && test "$module" = yes; then
  1488. -      $echo "$modename: \`-export-symbols' is not supported for modules"
  1489. -      exit 1
  1490. +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1491. +      eval arg=\"$export_dynamic_flag_spec\"
  1492. +      compile_command="$compile_command $arg"
  1493. +      finalize_command="$finalize_command $arg"
  1494.      fi
  1495. -    
  1496. +
  1497.      oldlibs=
  1498.      # calculate the name of the file, without its directory
  1499.      outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1500. +    libobjs_save="$libobjs"
  1501.  
  1502.      case "$output" in
  1503.      "")
  1504. @@ -1088,32 +1503,36 @@
  1505.  
  1506.      *.a | *.lib)
  1507.        if test -n "$link_against_libtool_libs"; then
  1508. -        $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1509. -        exit 1
  1510. +    $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1511. +    exit 1
  1512.        fi
  1513.  
  1514.        if test -n "$deplibs"; then
  1515. -        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1516. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1517.        fi
  1518.  
  1519. -      if test -n "$dlfiles$dlprefiles"; then
  1520. -        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1521. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1522. +    $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1523.        fi
  1524.  
  1525.        if test -n "$rpath"; then
  1526. -        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1527. +    $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1528. +      fi
  1529. +
  1530. +      if test -n "$xrpath"; then
  1531. +    $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1532.        fi
  1533.  
  1534.        if test -n "$vinfo"; then
  1535. -        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1536. +    $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1537.        fi
  1538.  
  1539.        if test -n "$release"; then
  1540. -        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1541. +    $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1542.        fi
  1543.  
  1544. -      if test -n "$export_symbols"; then
  1545. -        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1546. +      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1547. +    $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1548.        fi
  1549.  
  1550.        # Now set the variables for building old libraries.
  1551. @@ -1124,42 +1543,46 @@
  1552.      *.la)
  1553.        # Make sure we only generate libraries of the form `libNAME.la'.
  1554.        case "$outputname" in
  1555. -      lib*) ;;
  1556. +      lib*)
  1557. +    name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1558. +    eval libname=\"$libname_spec\"
  1559. +    ;;
  1560.        *)
  1561. -    $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1562. -    $echo "$help" 1>&2
  1563. -    exit 1
  1564. +    if test "$module" = no; then
  1565. +      $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1566. +      $echo "$help" 1>&2
  1567. +      exit 1
  1568. +    fi
  1569. +    if test "$need_lib_prefix" != no; then
  1570. +      # Add the "lib" prefix for modules if required
  1571. +      name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1572. +      eval libname=\"$libname_spec\"
  1573. +    else
  1574. +      libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1575. +    fi
  1576.      ;;
  1577.        esac
  1578.  
  1579. -      name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1580. -      eval libname=\"$libname_spec\"
  1581. -
  1582.        output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1583.        if test "X$output_objdir" = "X$output"; then
  1584. -        output_objdir="$objdir"
  1585. +    output_objdir="$objdir"
  1586.        else
  1587. -        output_objdir="$output_objdir/$objdir"
  1588. +    output_objdir="$output_objdir/$objdir"
  1589.        fi
  1590.  
  1591. -      # All the library-specific variables (install_libdir is set above).
  1592. -      library_names=
  1593. -      old_library=
  1594. -      dlname=
  1595. -
  1596.        if test -n "$objs"; then
  1597. -        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1598. -        exit 1
  1599. +    $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1600. +    exit 1
  1601.        fi
  1602.  
  1603.        # How the heck are we supposed to write a wrapper for a shared library?
  1604.        if test -n "$link_against_libtool_libs"; then
  1605. -        $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1606. -        exit 1
  1607. +     $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1608. +     exit 1
  1609.        fi
  1610.  
  1611. -      if test -n "$dlfiles$dlprefiles"; then
  1612. -        $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1613. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1614. +    $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1615.        fi
  1616.  
  1617.        set dummy $rpath
  1618. @@ -1170,10 +1593,13 @@
  1619.  
  1620.        oldlibs=
  1621.        if test -z "$rpath"; then
  1622. -    # Building a libtool convenience library.
  1623. -        libext=al
  1624. -    oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1625. -    build_libtool_libs=convenience
  1626. +    if test "$build_libtool_libs" = yes; then
  1627. +      # Building a libtool convenience library.
  1628. +      libext=al
  1629. +      oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1630. +      build_libtool_libs=convenience
  1631. +      build_old_libs=yes
  1632. +    fi
  1633.      dependency_libs="$deplibs"
  1634.  
  1635.      if test -n "$vinfo"; then
  1636. @@ -1241,6 +1667,20 @@
  1637.      case "$version_type" in
  1638.      none) ;;
  1639.  
  1640. +    irix)
  1641. +      major=`expr $current - $age + 1`
  1642. +      versuffix="$major.$revision"
  1643. +      verstring="sgi$major.$revision"
  1644. +
  1645. +      # Add in all the interfaces that we are compatible with.
  1646. +      loop=$revision
  1647. +      while test $loop != 0; do
  1648. +        iface=`expr $revision - $loop`
  1649. +        loop=`expr $loop - 1`
  1650. +        verstring="sgi$major.$iface:$verstring"
  1651. +      done
  1652. +      ;;
  1653. +
  1654.      linux)
  1655.        major=.`expr $current - $age`
  1656.        versuffix="$major.$age.$revision"
  1657. @@ -1295,15 +1735,21 @@
  1658.      # Clear the version info if we defaulted, and they specified a release.
  1659.      if test -z "$vinfo" && test -n "$release"; then
  1660.        major=
  1661. -      versuffix=
  1662.        verstring="0.0"
  1663. -      case "$host" in
  1664. -      *-*-sunos*)
  1665. +      if test "$need_version" = no; then
  1666. +        versuffix=
  1667. +      else
  1668.          versuffix=".0.0"
  1669. -        ;;
  1670. -      esac
  1671. +      fi
  1672.      fi
  1673.  
  1674. +    # Remove version info from name if versioning should be avoided
  1675. +    if test "$avoid_version" = yes && test "$need_version" = no; then
  1676. +      major=
  1677. +      versuffix=
  1678. +      verstring=""
  1679. +    fi
  1680. +    
  1681.      # Check to see if the archive will have undefined symbols.
  1682.      if test "$allow_undefined" = yes; then
  1683.        if test "$allow_undefined_flag" = unsupported; then
  1684. @@ -1316,22 +1762,29 @@
  1685.        allow_undefined_flag="$no_undefined_flag"
  1686.      fi
  1687.  
  1688. -    # Add libc to deplibs on all systems.
  1689.      dependency_libs="$deplibs"
  1690. -    deplibs="$deplibs -lc"
  1691. +    case "$host" in
  1692. +    *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1693. +      # these systems don't actually have a c library (as such)!
  1694. +      ;;
  1695. +    *)
  1696. +      # Add libc to deplibs on all other systems.
  1697. +      deplibs="$deplibs -lc"
  1698. +      ;;
  1699. +    esac
  1700.        fi
  1701.  
  1702.        # Create the output directory, or remove our outputs if we need to.
  1703.        if test -d $output_objdir; then
  1704. -        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1705. +    $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1706.      $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1707.        else
  1708. -        $show "$mkdir $output_objdir"
  1709. -        $run $mkdir $output_objdir
  1710. -        status=$?
  1711. -        if test $status -ne 0 && test ! -d $output_objdir; then
  1712. -          exit $status
  1713. -        fi
  1714. +    $show "$mkdir $output_objdir"
  1715. +    $run $mkdir $output_objdir
  1716. +    status=$?
  1717. +    if test $status -ne 0 && test ! -d $output_objdir; then
  1718. +      exit $status
  1719. +    fi
  1720.        fi
  1721.  
  1722.        # Now set the variables for building old libraries.
  1723. @@ -1339,173 +1792,220 @@
  1724.      oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1725.  
  1726.      # Transform .lo files to .o files.
  1727. -    oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.'${libext}' //g' -e "$los2o" -e 's/ $//g'`
  1728. +    oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1729.        fi
  1730.  
  1731.        if test "$build_libtool_libs" = yes; then
  1732. -        # Transform deplibs into only deplibs that can be linked in shared.
  1733. -        ## Gordon: Do you check for the existence of the libraries in deplibs
  1734. -        ## on the system?  That should maybe be merged in here someplace....
  1735. -        ## Actually: I think test_compile and file_magic do this... file_regex
  1736. -        ## sorta does this. Only pas_all needs to be changed.  -Toshio
  1737. -        name_save=$name
  1738. -        libname_save=$libname
  1739. -        release_save=$release
  1740. -        versuffix_save=$versuffix
  1741. -        major_save=$major
  1742. -        # I'm not sure if I'm treating the release correctly.  I think
  1743. -        # release should show up in the -l (ie -lgmp5) so we don't want to
  1744. -        # add it in twice.  Is that correct?
  1745. -        release=""
  1746. -        versuffix=""
  1747. -        major=""
  1748. -        newdeplibs=
  1749. -        case "$check_shared_deplibs_method" in
  1750. -        pass_all)  
  1751. -          newdeplibs=$deplibs 
  1752. -                    ;; # Don't check for shared/static.  Everything works.
  1753. -                       # This might be a little naive.  We might want to check
  1754. -                       # whether the library exists or not.  But this is on
  1755. -                       # osf3 & osf4 and I'm not really sure... Just
  1756. -                       # implementing what was already the behaviour.
  1757. -        test_compile)
  1758. -          # This code stresses the "libraries are programs" paradigm to its
  1759. -          # limits. Maybe even breaks it.  We compile a program, linking it
  1760. -          # against the deplibs as a proxy for the library.  Then we can check
  1761. -          # whether they linked in statically or dynamically with ldd.
  1762. -          $rm conftest.c
  1763. -          cat > conftest.c <<EOF
  1764. -          int main() { return 0; }
  1765. +    # Transform deplibs into only deplibs that can be linked in shared.
  1766. +    name_save=$name
  1767. +    libname_save=$libname
  1768. +    release_save=$release
  1769. +    versuffix_save=$versuffix
  1770. +    major_save=$major
  1771. +    # I'm not sure if I'm treating the release correctly.  I think
  1772. +    # release should show up in the -l (ie -lgmp5) so we don't want to
  1773. +    # add it in twice.  Is that correct?
  1774. +    release=""
  1775. +    versuffix=""
  1776. +    major=""
  1777. +    newdeplibs=
  1778. +    droppeddeps=no
  1779. +    case "$deplibs_check_method" in
  1780. +    pass_all)
  1781. +      # Don't check for shared/static.  Everything works.
  1782. +      # This might be a little naive.  We might want to check
  1783. +      # whether the library exists or not.  But this is on
  1784. +      # osf3 & osf4 and I'm not really sure... Just
  1785. +      # implementing what was already the behaviour.
  1786. +      newdeplibs=$deplibs
  1787. +      ;;
  1788. +    test_compile)
  1789. +      # This code stresses the "libraries are programs" paradigm to its
  1790. +      # limits. Maybe even breaks it.  We compile a program, linking it
  1791. +      # against the deplibs as a proxy for the library.  Then we can check
  1792. +      # whether they linked in statically or dynamically with ldd.
  1793. +      $rm conftest.c
  1794. +      cat > conftest.c <<EOF
  1795. +      int main() { return 0; }
  1796.  EOF
  1797. -          $rm a.out
  1798. -          $C_compiler conftest.c $deplibs
  1799. -          if test $? -eq 0 ; then
  1800. -            ldd_output=`ldd a.out`
  1801. -            for i in $deplibs; do
  1802. -              name="`expr $i : '-l\(.*\)'`"
  1803. -              # If $name is empty we are operating on a -L argument.
  1804. -              if test "$name" != "" ; then
  1805. -                libname=`eval \\$echo \"$libname_spec\"`
  1806. -                deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1807. -                set dummy $deplib_matches
  1808. -                deplib_match=$2
  1809. -                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1810. -                  newdeplibs="$newdeplibs $i"
  1811. -                else
  1812. -                  echo
  1813. -                  echo "*** Warning: This library needs some functionality provided by $i."
  1814. -                  echo "*** I have the capability to make that library automatically link in when"
  1815. -                  echo "*** you link to this library.  But I can only do this if you have a"
  1816. -                  echo "*** shared version of the library, which you do not appear to have."
  1817. -                fi
  1818. -              else
  1819. -                newdeplibs="$newdeplibs $i"
  1820. -              fi
  1821. -            done
  1822. -          else
  1823. -            # Error occured in the first compile.  Let's try to salvage the situation:
  1824. -            # Compile a seperate program for each library.
  1825. -            for i in $deplibs; do
  1826. -              name="`expr $i : '-l\(.*\)'`"
  1827. -             # If $name is empty we are operating on a -L argument.
  1828. -              if test "$name" != "" ; then
  1829. -                $rm a.out
  1830. -                $C_compiler conftest.c $i
  1831. -                # Did it work?
  1832. -                if test $? -eq 0 ; then
  1833. -                  ldd_output=`ldd a.out`
  1834. -                    libname=`eval \\$echo \"$libname_spec\"`
  1835. -                    deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1836. -                    set dummy $deplib_matches
  1837. -                    deplib_match=$2
  1838. -                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1839. -                      newdeplibs="$newdeplibs $i"
  1840. -                    else
  1841. -                      echo
  1842. -                      echo "*** Warning: This library needs some functionality provided by $i."
  1843. -                      echo "*** I have the capability to make that library automatically link in when"
  1844. -                      echo "*** you link to this library.  But I can only do this if you have a"
  1845. -                      echo "*** shared version of the library, which you do not appear to have."
  1846. -                    fi
  1847. -                else
  1848. -                  echo
  1849. -                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
  1850. -                  echo "***  make it link in!  You will probably need to install it or some"
  1851. -                  echo "*** library that it depends on before this library will be fully"
  1852. -                  echo "*** functional.  Installing it before continuing would be even better."
  1853. -                fi
  1854. -              else
  1855. -                newdeplibs="$newdeplibs $i"
  1856. -              fi
  1857. -            done
  1858. -          fi
  1859. -          deplibs=$newdeplibs
  1860. -          ;;
  1861. -        file_magic* | file_regex)
  1862. -          set dummy $check_shared_deplibs_method
  1863. -          file_magic_regex="`expr \"$check_shared_deplibs_method\" : \"$2\(.*\)\"`"
  1864. -          for a_deplib in $deplibs; do
  1865. -            name="`expr $a_deplib : '-l\(.*\)'`"
  1866. -            # If $name is empty we are operating on a -L argument.
  1867. -            if test "$name" != "" ; then
  1868. -              libname=`eval \\$echo \"$libname_spec\"`
  1869. -              case "$check_shared_deplibs_method" in
  1870. -                file_magic*)
  1871. -                  for i in $lib_search_path; do
  1872. -                   # This needs to be more general than file_regex in order to
  1873. -                   # catch things like glibc on linux.  Maybe file_regex
  1874. -                   # should be more general as well, but maybe not.  Since
  1875. -                   # library names are supposed to conform to
  1876. -                   # library_name_spec, I think file_regex should remain
  1877. -                   # strict.  What do you think Gordon?
  1878. -                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1879. -                    for potent_lib in $potential_libs; do
  1880. -                      file_output=`file $potent_lib`
  1881. -                      if test `expr "$file_output" : ".*$file_magic_regex"` -ne 0 ; then
  1882. -                        newdeplibs="$newdeplibs $a_deplib"
  1883. -                        a_deplib=""
  1884. -                        break 2
  1885. -                      fi
  1886. -                    done
  1887. -                  done
  1888. -                  ;;
  1889. -                file_regex)
  1890. -                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1891. -                  set dummy $deplib_matches
  1892. -                  deplib_match=$2
  1893. -                  for i in $lib_search_path; do
  1894. -                    potential_libs=`ls $i/$deplib_match* 2>/dev/null`
  1895. -                    if test "$potential_libs" != "" ; then
  1896. -                      newdeplibs="$newdeplibs $a_deplib"
  1897. -                      a_deplib=""
  1898. -                      break
  1899. -                    fi
  1900. -                  done
  1901. -                  ;;
  1902. -              esac
  1903. -              if test "$a_deplib" != "" ; then
  1904. -                echo
  1905. -                echo "*** Warning: This library needs some functionality provided by $a_deplib."
  1906. -                echo "*** I have the capability to make that library automatically link in when"
  1907. -                echo "*** you link to this library.  But I can only do this if you have a"
  1908. -                echo "*** shared version of the library, which you do not appear to have."
  1909. -              fi
  1910. -            else
  1911. -              # Add a -L argument.
  1912. -              newdeplibs="$newdeplibs $a_deplib"
  1913. -            fi
  1914. -          done # Gone through all deplibs.
  1915. -          ;;
  1916. -        none | *)  deplibs="" ;;
  1917. -        esac
  1918. -        versuffix=$versuffix_save
  1919. -        major=$major_save
  1920. -        release=$release_save
  1921. -        libname=$libname_save
  1922. -        name=$name_save
  1923. -        deplibs=$newdeplibs
  1924. -        # Done checking deplibs!
  1925. +      $rm conftest
  1926. +      $C_compiler -o conftest conftest.c $deplibs
  1927. +      if test $? -eq 0 ; then
  1928. +        ldd_output=`ldd conftest`
  1929. +        for i in $deplibs; do
  1930. +          name="`expr $i : '-l\(.*\)'`"
  1931. +          # If $name is empty we are operating on a -L argument.
  1932. +          if test "$name" != "" ; then
  1933. +        libname=`eval \\$echo \"$libname_spec\"`
  1934. +        deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1935. +        set dummy $deplib_matches
  1936. +        deplib_match=$2
  1937. +        if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1938. +          newdeplibs="$newdeplibs $i"
  1939. +        else
  1940. +          droppeddeps=yes
  1941. +          echo
  1942. +          echo "*** Warning: This library needs some functionality provided by $i."
  1943. +          echo "*** I have the capability to make that library automatically link in when"
  1944. +          echo "*** you link to this library.  But I can only do this if you have a"
  1945. +          echo "*** shared version of the library, which you do not appear to have."
  1946. +        fi
  1947. +          else
  1948. +        newdeplibs="$newdeplibs $i"
  1949. +          fi
  1950. +        done
  1951. +      else
  1952. +        # Error occured in the first compile.  Let's try to salvage the situation:
  1953. +        # Compile a seperate program for each library.
  1954. +        for i in $deplibs; do
  1955. +          name="`expr $i : '-l\(.*\)'`"
  1956. +         # If $name is empty we are operating on a -L argument.
  1957. +          if test "$name" != "" ; then
  1958. +        $rm conftest
  1959. +        $C_compiler -o conftest conftest.c $i
  1960. +        # Did it work?
  1961. +        if test $? -eq 0 ; then
  1962. +          ldd_output=`ldd conftest`
  1963. +          libname=`eval \\$echo \"$libname_spec\"`
  1964. +          deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1965. +          set dummy $deplib_matches
  1966. +          deplib_match=$2
  1967. +          if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1968. +            newdeplibs="$newdeplibs $i"
  1969. +          else
  1970. +            droppeddeps=yes
  1971. +            echo
  1972. +            echo "*** Warning: This library needs some functionality provided by $i."
  1973. +            echo "*** I have the capability to make that library automatically link in when"
  1974. +            echo "*** you link to this library.  But I can only do this if you have a"
  1975. +            echo "*** shared version of the library, which you do not appear to have."
  1976. +          fi
  1977. +        else
  1978. +          droppeddeps=yes
  1979. +          echo
  1980. +          echo "*** Warning!  Library $i is needed by this library but I was not able to"
  1981. +          echo "***  make it link in!  You will probably need to install it or some"
  1982. +          echo "*** library that it depends on before this library will be fully"
  1983. +          echo "*** functional.  Installing it before continuing would be even better."
  1984. +        fi
  1985. +          else
  1986. +        newdeplibs="$newdeplibs $i"
  1987. +          fi
  1988. +        done
  1989. +      fi
  1990. +      ;;
  1991. +    file_magic*)
  1992. +      set dummy $deplibs_check_method
  1993. +      file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  1994. +      for a_deplib in $deplibs; do
  1995. +        name="`expr $a_deplib : '-l\(.*\)'`"
  1996. +        # If $name is empty we are operating on a -L argument.
  1997. +        if test "$name" != "" ; then
  1998. +          libname=`eval \\$echo \"$libname_spec\"`
  1999. +          for i in $lib_search_path; do
  2000. +            potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2001. +            for potent_lib in $potential_libs; do
  2002. +              # Follow soft links.
  2003. +              if ls -lLd "$potent_lib" 2>/dev/null \
  2004. +             | grep " -> " >/dev/null; then
  2005. +            continue 
  2006. +              fi
  2007. +              # The statement above tries to avoid entering an
  2008. +              # endless loop below, in case of cyclic links.
  2009. +              # We might still enter an endless loop, since a link
  2010. +              # loop can be closed while we follow links,
  2011. +              # but so what?
  2012. +              potlib="$potent_lib"
  2013. +              while test -h "$potlib" 2>/dev/null; do
  2014. +            potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  2015. +            case "$potliblink" in
  2016. +            [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  2017. +            *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2018. +            esac
  2019. +              done
  2020. +              if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  2021. +             | sed 10q \
  2022. +             | egrep "$file_magic_regex" > /dev/null; then
  2023. +            newdeplibs="$newdeplibs $a_deplib"
  2024. +            a_deplib=""
  2025. +            break 2
  2026. +              fi
  2027. +            done
  2028. +          done
  2029. +          if test -n "$a_deplib" ; then
  2030. +        droppeddeps=yes
  2031. +        echo
  2032. +        echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2033. +        echo "*** I have the capability to make that library automatically link in when"
  2034. +        echo "*** you link to this library.  But I can only do this if you have a"
  2035. +        echo "*** shared version of the library, which you do not appear to have."
  2036. +          fi
  2037. +        else
  2038. +          # Add a -L argument.
  2039. +          newdeplibs="$newdeplibs $a_deplib"
  2040. +        fi
  2041. +      done # Gone through all deplibs.
  2042. +      ;;
  2043. +    none | unknown | *)
  2044. +      newdeplibs=""
  2045. +      if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2046. +           -e 's/ -[LR][^ ]*//g' -e 's/[     ]//g' |
  2047. +         grep . >/dev/null; then
  2048. +        echo
  2049. +        if test "X$deplibs_check_method" = "Xnone"; then
  2050. +          echo "*** Warning: inter-library dependencies are not supported in this platform."
  2051. +        else
  2052. +          echo "*** Warning: inter-library dependencies are not known to be supported."
  2053. +        fi
  2054. +        echo "*** All declared inter-library dependencies are being dropped."
  2055. +        droppeddeps=yes
  2056. +      fi
  2057. +      ;;
  2058. +    esac
  2059. +    versuffix=$versuffix_save
  2060. +    major=$major_save
  2061. +    release=$release_save
  2062. +    libname=$libname_save
  2063. +    name=$name_save
  2064. +
  2065. +    if test "$droppeddeps" = yes; then
  2066. +      if test "$module" = yes; then
  2067. +        echo
  2068. +        echo "*** Warning: libtool could not satisfy all declared inter-library"
  2069. +        echo "*** dependencies of module $libname.  Therefore, libtool will create"
  2070. +        echo "*** a static module, that should work as long as the dlopening"
  2071. +        echo "*** application is linked with the -dlopen flag."
  2072. +        if test -z "$global_symbol_pipe"; then
  2073. +          echo
  2074. +          echo "*** However, this would only work if libtool was able to extract symbol"
  2075. +          echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2076. +          echo "*** not find such a program.  So, this module is probably useless."
  2077. +          echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2078. +        fi
  2079. +        if test "$build_old_libs" = no; then
  2080. +          oldlibs="$output_objdir/$libname.$libext"
  2081. +          build_libtool_libs=module
  2082. +          build_old_libs=yes
  2083. +        else
  2084. +          build_libtool_libs=no
  2085. +        fi
  2086. +      else
  2087. +        echo "*** The inter-library dependencies that have been dropped here will be"
  2088. +        echo "*** automatically added whenever a program is linked with this library"
  2089. +        echo "*** or is declared to -dlopen it."
  2090. +      fi
  2091. +    fi
  2092. +    # Done checking deplibs!
  2093. +    deplibs=$newdeplibs
  2094. +      fi
  2095. +
  2096. +      # All the library-specific variables (install_libdir is set above).
  2097. +      library_names=
  2098. +      old_library=
  2099. +      dlname=
  2100. +      
  2101. +      # Test again, we may have decided not to build it any more
  2102. +      if test "$build_libtool_libs" = yes; then
  2103.      # Get the real and link names of the library.
  2104.      eval library_names=\"$library_names_spec\"
  2105.      set dummy $library_names
  2106. @@ -1524,8 +2024,18 @@
  2107.        linknames="$linknames $link"
  2108.      done
  2109.  
  2110. -    # Use standard objects if they are PIC.
  2111. -    test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e "$los2o" -e 's/ $//g'`
  2112. +    # Ensure that we have .o objects for linkers which dislike .lo
  2113. +    # (e.g. aix) incase we are running --disable-static
  2114. +    for obj in $libobjs; do
  2115. +      oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  2116. +      if test ! -f $oldobj; then
  2117. +        $show "${LN_S} $obj $oldobj"
  2118. +        $run ${LN_S} $obj $oldobj || exit $?
  2119. +      fi
  2120. +    done
  2121. +
  2122. +    # Use standard objects if they are pic
  2123. +    test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2124.  
  2125.      if test -n "$whole_archive_flag_spec"; then
  2126.        if test -n "$convenience"; then
  2127. @@ -1532,11 +2042,25 @@
  2128.          eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2129.        fi
  2130.      else
  2131. +      gentop="$output_objdir/${outputname}x"
  2132. +      $show "${rm}r $gentop"
  2133. +      $run ${rm}r "$gentop"
  2134. +      $show "mkdir $gentop"
  2135. +      $run mkdir "$gentop"
  2136. +      status=$?
  2137. +      if test $status -ne 0 && test ! -d "$gentop"; then
  2138. +        exit $status
  2139. +      fi
  2140. +      generated="$generated $gentop"
  2141. +      
  2142.        for xlib in $convenience; do
  2143.          # Extract the objects.
  2144. -        xdir="$xlib"x
  2145. -        generated="$generated $xdir"
  2146. -        xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  2147. +        case "$xlib" in
  2148. +        [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2149. +        *) xabs=`pwd`"/$xlib" ;;
  2150. +        esac
  2151. +        xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2152. +        xdir="$gentop/$xlib"
  2153.  
  2154.          $show "${rm}r $xdir"
  2155.          $run ${rm}r "$xdir"
  2156. @@ -1546,16 +2070,48 @@
  2157.          if test $status -ne 0 && test ! -d "$xdir"; then
  2158.            exit $status
  2159.          fi
  2160. -        $show "(cd $xdir && $AR x ../$xlib)"
  2161. -        $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  2162. +        $show "(cd $xdir && $AR x $xabs)"
  2163. +        $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2164.  
  2165. -        libobjs="$libobjs `echo $xdir/*`"
  2166. +        libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2167.        done
  2168.      fi
  2169.  
  2170. +    if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2171. +      eval flag=\"$thread_safe_flag_spec\"
  2172. +      linkopts="$linkopts $flag"
  2173. +    fi
  2174. +
  2175. +    # Prepare the list of exported symbols
  2176. +    if test -z "$export_symbols"; then
  2177. +      if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2178. +        $show "generating symbol list for \`$libname.la'"
  2179. +        export_symbols="$output_objdir/$libname.exp"
  2180. +        $run $rm $export_symbols
  2181. +        eval cmds=\"$export_symbols_cmds\"
  2182. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2183. +        for cmd in $cmds; do
  2184. +          IFS="$save_ifs"
  2185. +          $show "$cmd"
  2186. +          $run eval "$cmd" || exit $?
  2187. +        done
  2188. +        IFS="$save_ifs"
  2189. +        if test -n "$export_symbols_regex"; then
  2190. +          $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2191. +          $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2192. +          $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2193. +          $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2194. +        fi
  2195. +      fi
  2196. +    fi
  2197. +
  2198. +    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2199. +      $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2200. +    fi
  2201. +
  2202.      # Do each of the archive commands.
  2203. -    if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
  2204. -      eval cmds=\"$archive_sym_cmds\"
  2205. +    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2206. +      eval cmds=\"$archive_expsym_cmds\"
  2207.      else
  2208.        eval cmds=\"$archive_cmds\"
  2209.      fi
  2210. @@ -1570,8 +2126,8 @@
  2211.      # Create links to the real library.
  2212.      for linkname in $linknames; do
  2213.        if test "$realname" != "$linkname"; then
  2214. -        $show "(cd $output_objdir && $LN_S $realname $linkname)"
  2215. -        $run eval '(cd $output_objdir && $LN_S $realname $linkname)' || exit $?
  2216. +        $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2217. +        $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2218.        fi
  2219.      done
  2220.  
  2221. @@ -1585,43 +2141,47 @@
  2222.  
  2223.      *.lo | *.o | *.obj)
  2224.        if test -n "$link_against_libtool_libs"; then
  2225. -        $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2226. -        exit 1
  2227. +    $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2228. +    exit 1
  2229.        fi
  2230.  
  2231.        if test -n "$deplibs"; then
  2232. -        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2233. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2234.        fi
  2235.  
  2236. -      if test -n "$dlfiles$dlprefiles"; then
  2237. -        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2238. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2239. +    $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2240.        fi
  2241.  
  2242.        if test -n "$rpath"; then
  2243. -        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2244. +    $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2245. +      fi
  2246. +
  2247. +      if test -n "$xrpath"; then
  2248. +    $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2249.        fi
  2250.  
  2251.        if test -n "$vinfo"; then
  2252. -        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2253. +    $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2254.        fi
  2255.  
  2256.        if test -n "$release"; then
  2257. -        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2258. +    $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2259.        fi
  2260.  
  2261.        case "$output" in
  2262.        *.lo)
  2263. -        if test -n "$objs"; then
  2264. -          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2265. -          exit 1
  2266. -        fi
  2267. -        libobj="$output"
  2268. -        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2269. -        ;;
  2270. +    if test -n "$objs"; then
  2271. +      $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2272. +      exit 1
  2273. +    fi
  2274. +    libobj="$output"
  2275. +    obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2276. +    ;;
  2277.        *)
  2278. -        libobj=
  2279. -        obj="$output"
  2280. -        ;;
  2281. +    libobj=
  2282. +    obj="$output"
  2283. +    ;;
  2284.        esac
  2285.  
  2286.        # Delete the old objects.
  2287. @@ -1628,15 +2188,15 @@
  2288.        $run $rm $obj $libobj
  2289.  
  2290.        # Create the old-style object.
  2291. -      reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^       ]*\.'${libext}' //g' -e 's/[^       ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
  2292. +      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2293.  
  2294.        output="$obj"
  2295.        eval cmds=\"$reload_cmds\"
  2296.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2297.        for cmd in $cmds; do
  2298. -        IFS="$save_ifs"
  2299. -        $show "$cmd"
  2300. -        $run eval "$cmd" || exit $?
  2301. +    IFS="$save_ifs"
  2302. +    $show "$cmd"
  2303. +    $run eval "$cmd" || exit $?
  2304.        done
  2305.        IFS="$save_ifs"
  2306.  
  2307. @@ -1644,29 +2204,31 @@
  2308.        test -z "$libobj" && exit 0
  2309.  
  2310.        if test "$build_libtool_libs" != yes; then
  2311. -        # Create an invalid libtool object if no PIC, so that we don't
  2312. -        # accidentally link it into a program.
  2313. -        $show "echo timestamp > $libobj"
  2314. -        $run eval "echo timestamp > $libobj" || exit $?
  2315. -        exit 0
  2316. +    # Create an invalid libtool object if no PIC, so that we don't
  2317. +    # accidentally link it into a program.
  2318. +    $show "echo timestamp > $libobj"
  2319. +    $run eval "echo timestamp > $libobj" || exit $?
  2320. +    exit 0
  2321.        fi
  2322.  
  2323.        if test -n "$pic_flag"; then
  2324. -        # Only do commands if we really have different PIC objects.
  2325. -        reload_objs="$libobjs"
  2326. -        output="$libobj"
  2327. -        eval cmds=\"$reload_cmds\"
  2328. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2329. -        for cmd in $cmds; do
  2330. -          IFS="$save_ifs"
  2331. -          $show "$cmd"
  2332. -          $run eval "$cmd" || exit $?
  2333. -        done
  2334. -        IFS="$save_ifs"
  2335. +    # Only do commands if we really have different PIC objects.
  2336. +    reload_objs="$libobjs"
  2337. +    output="$libobj"
  2338. +    eval cmds=\"$reload_cmds\"
  2339. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2340. +    for cmd in $cmds; do
  2341. +      IFS="$save_ifs"
  2342. +      $show "$cmd"
  2343. +      $run eval "$cmd" || exit $?
  2344. +    done
  2345. +    IFS="$save_ifs"
  2346.        else
  2347. -        # Just create a symlink.
  2348. -        $show "$LN_S $obj $libobj"
  2349. -        $run $LN_S $obj $libobj || exit $?
  2350. +    # Just create a symlink.
  2351. +    $show $rm $libobj
  2352. +    $run $rm $libobj
  2353. +    $show "$LN_S $obj $libobj"
  2354. +    $run $LN_S $obj $libobj || exit $?
  2355.        fi
  2356.  
  2357.        exit 0
  2358. @@ -1675,105 +2237,156 @@
  2359.      # Anything else should be a program.
  2360.      *)
  2361.        if test -n "$vinfo"; then
  2362. -        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2363. +    $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2364.        fi
  2365.  
  2366.        if test -n "$release"; then
  2367. -        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2368. +    $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2369.        fi
  2370.  
  2371. -      if test -n "$rpath"; then
  2372. +      if test "$preload" = yes; then
  2373. +    if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2374. +       test "$dlopen_self_static" = unknown; then
  2375. +      $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2376. +    fi 
  2377. +      fi
  2378. +    
  2379. +      if test -n "$rpath$xrpath"; then
  2380.      # If the user specified any rpath flags, then add them.
  2381. -    for libdir in $rpath; do
  2382. -          if test -n "$hardcode_libdir_flag_spec"; then
  2383. -            if test -n "$hardcode_libdir_separator"; then
  2384. -              if test -z "$hardcode_libdirs"; then
  2385. -                # Put the magic libdir with the hardcode flag.
  2386. -                hardcode_libdirs="$libdir"
  2387. -                libdir="@HARDCODE_LIBDIRS@"
  2388. -              else
  2389. -                # Just accumulate the unique libdirs.
  2390. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2391. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2392. -          ;;
  2393. -        *)
  2394. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2395. -          ;;
  2396. -        esac
  2397. -                libdir=
  2398. -              fi
  2399. -            fi
  2400. -
  2401. -            if test -n "$libdir"; then
  2402. -              eval flag=\"$hardcode_libdir_flag_spec\"
  2403. -
  2404. -              compile_command="$compile_command $flag"
  2405. -              finalize_command="$finalize_command $flag"
  2406. -            fi
  2407. -          elif test -n "$runpath_var"; then
  2408. -            case "$perm_rpath " in
  2409. -            *" $libdir "*) ;;
  2410. -            *) perm_rpath="$perm_rpath $libdir" ;;
  2411. -            esac
  2412. -          fi
  2413. +    for libdir in $rpath $xrpath; do
  2414. +      # This is the magic to use -rpath.
  2415. +      case "$compile_rpath " in
  2416. +      *" $libdir "*) ;;
  2417. +      *) compile_rpath="$compile_rpath $libdir" ;;
  2418. +      esac
  2419. +      case "$finalize_rpath " in
  2420. +      *" $libdir "*) ;;
  2421. +      *) finalize_rpath="$finalize_rpath $libdir" ;;
  2422. +      esac
  2423.      done
  2424.        fi
  2425.  
  2426. -      # Substitute the hardcoded libdirs into the compile commands.
  2427. -      if test -n "$hardcode_libdir_separator"; then
  2428. -    compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2429. -    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2430. +      # Now hardcode the library paths
  2431. +      rpath=
  2432. +      hardcode_libdirs=
  2433. +      for libdir in $compile_rpath $finalize_rpath; do
  2434. +    if test -n "$hardcode_libdir_flag_spec"; then
  2435. +      if test -n "$hardcode_libdir_separator"; then
  2436. +        if test -z "$hardcode_libdirs"; then
  2437. +          hardcode_libdirs="$libdir"
  2438. +        else
  2439. +          # Just accumulate the unique libdirs.
  2440. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2441. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2442. +        ;;
  2443. +          *)
  2444. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2445. +        ;;
  2446. +          esac
  2447. +        fi
  2448. +      else
  2449. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2450. +        rpath="$rpath $flag"
  2451. +      fi
  2452. +    elif test -n "$runpath_var"; then
  2453. +      case "$perm_rpath " in
  2454. +      *" $libdir "*) ;;
  2455. +      *) perm_rpath="$perm_rpath $libdir" ;;
  2456. +      esac
  2457. +    fi
  2458. +      done
  2459. +      # Substitute the hardcoded libdirs into the rpath.
  2460. +      if test -n "$hardcode_libdir_separator" &&
  2461. +     test -n "$hardcode_libdirs"; then
  2462. +    libdir="$hardcode_libdirs"
  2463. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2464. +      fi
  2465. +      compile_rpath="$rpath"
  2466. +
  2467. +      rpath=
  2468. +      hardcode_libdirs=
  2469. +      for libdir in $finalize_rpath; do
  2470. +    if test -n "$hardcode_libdir_flag_spec"; then
  2471. +      if test -n "$hardcode_libdir_separator"; then
  2472. +        if test -z "$hardcode_libdirs"; then
  2473. +          hardcode_libdirs="$libdir"
  2474. +        else
  2475. +          # Just accumulate the unique libdirs.
  2476. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2477. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2478. +        ;;
  2479. +          *)
  2480. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2481. +        ;;
  2482. +          esac
  2483. +        fi
  2484. +      else
  2485. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2486. +        rpath="$rpath $flag"
  2487. +      fi
  2488. +    elif test -n "$runpath_var"; then
  2489. +      case "$finalize_perm_rpath " in
  2490. +      *" $libdir "*) ;;
  2491. +      *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2492. +      esac
  2493. +    fi
  2494. +      done
  2495. +      # Substitute the hardcoded libdirs into the rpath.
  2496. +      if test -n "$hardcode_libdir_separator" &&
  2497. +     test -n "$hardcode_libdirs"; then
  2498. +    libdir="$hardcode_libdirs"
  2499. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2500.        fi
  2501. +      finalize_rpath="$rpath"
  2502.  
  2503.        output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2504.        if test "X$output_objdir" = "X$output"; then
  2505. -        output_objdir="$objdir"
  2506. +    output_objdir="$objdir"
  2507.        else
  2508. -        output_objdir="$output_objdir/$objdir"
  2509. +    output_objdir="$output_objdir/$objdir"
  2510. +      fi
  2511. +
  2512. +      # Create the binary in the object directory, then wrap it.
  2513. +      if test ! -d $output_objdir; then
  2514. +    $show "$mkdir $output_objdir"
  2515. +    $run $mkdir $output_objdir
  2516. +    status=$?
  2517. +    if test $status -ne 0 && test ! -d $output_objdir; then
  2518. +      exit $status
  2519. +    fi
  2520.        fi
  2521.  
  2522.        if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2523. -        # Transform all the library objects into standard objects.
  2524. -        compile_command=`$echo "X$compile_command " | $Xsed -e "$los2o" -e 's/ $//'`
  2525. -        finalize_command=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'`
  2526. +    # Transform all the library objects into standard objects.
  2527. +    compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2528. +    finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2529.        fi
  2530.  
  2531. -      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
  2532. -        dlsyms="${outputname}S.c"
  2533. -      else
  2534. -        dlsyms=
  2535. +      dlsyms=
  2536. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
  2537. +    if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2538. +      dlsyms="${outputname}S.c"
  2539. +    else
  2540. +      $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2541. +    fi
  2542.        fi
  2543.  
  2544.        if test -n "$dlsyms"; then
  2545. -        case "$dlsyms" in
  2546. -        "") ;;
  2547. -        *.c)
  2548. -          if test -z "$export_symbols"; then
  2549. -            # Add our own program objects to the preloaded list.
  2550. -            dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e "$los2o" -e 's/ $//'`
  2551. -          fi
  2552. -
  2553. -          # Discover the nlist of each of the dlfiles.
  2554. -          nlist="$objdir/${output}.nm"
  2555. -
  2556. -      if test -d $objdir; then
  2557. -        $show "$rm $nlist ${nlist}T"
  2558. -        $run $rm "$nlist" "${nlist}T"
  2559. -      else
  2560. -        $show "$mkdir $objdir"
  2561. -        $run $mkdir $objdir
  2562. -        status=$?
  2563. -        if test $status -ne 0 && test ! -d $objdir; then
  2564. -          exit $status
  2565. -        fi
  2566. -      fi
  2567. +    case "$dlsyms" in
  2568. +    "") ;;
  2569. +    *.c)
  2570. +      # Discover the nlist of each of the dlfiles.
  2571. +      nlist="$output_objdir/${outputname}.nm"
  2572.  
  2573. -          # Parse the name list into a source file.
  2574. -          $show "creating $objdir/$dlsyms"
  2575. +      $show "$rm $nlist ${nlist}S ${nlist}T"
  2576. +      $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2577.  
  2578. -          $echo > "$objdir/$dlsyms" "\
  2579. +      # Parse the name list into a source file.
  2580. +      $show "creating $output_objdir/$dlsyms"
  2581. +
  2582. +      test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  2583.  /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2584. -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
  2585. +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2586.  
  2587.  #ifdef __cplusplus
  2588.  extern \"C\" {
  2589. @@ -1780,215 +2393,286 @@
  2590.  #endif
  2591.  
  2592.  /* Prevent the only kind of declaration conflicts we can make. */
  2593. -#define dld_preloaded_symbols some_other_symbol
  2594. +#define lt_preloaded_symbols some_other_symbol
  2595.  
  2596.  /* External symbol declarations for the compiler. */\
  2597.  "
  2598.  
  2599. -          if test -n "$export_symbols"; then
  2600. -        sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
  2601. -          fi
  2602. +      if test "$dlself" = yes; then
  2603. +        $show "generating symbol list for \`$output'"
  2604. +
  2605. +        test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  2606. +
  2607. +        # Add our own program objects to the symbol list.
  2608. +        progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2609. +        for arg in $progfiles; do
  2610. +          $show "extracting global C symbols from \`$arg'"
  2611. +          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2612. +        done
  2613. +
  2614. +        if test -n "$exclude_expsyms"; then
  2615. +          $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2616. +          $run eval '$mv "$nlist"T "$nlist"'
  2617. +        fi
  2618. +        
  2619. +        if test -n "$export_symbols_regex"; then
  2620. +          $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2621. +          $run eval '$mv "$nlist"T "$nlist"'
  2622. +        fi
  2623. +
  2624. +        # Prepare the list of exported symbols
  2625. +        if test -z "$export_symbols"; then
  2626. +          export_symbols="$output_objdir/$output.exp"
  2627. +          $run $rm $export_symbols
  2628. +          $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2629. +        else
  2630. +          $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  2631. +          $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  2632. +          $run eval 'mv "$nlist"T "$nlist"'
  2633. +        fi
  2634. +      fi
  2635.  
  2636. -          for arg in $dlprefiles; do
  2637. +      for arg in $dlprefiles; do
  2638.          $show "extracting global C symbols from \`$arg'"
  2639. +        name=`echo "$arg" | sed -e 's%^.*/%%'`
  2640. +        $run eval 'echo ": $name " >> "$nlist"'
  2641.          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2642. -          done
  2643. +      done
  2644.  
  2645. -          if test -z "$run"; then
  2646. -        # Make sure we at least have an empty file.
  2647. +      if test -z "$run"; then
  2648. +        # Make sure we have at least an empty file.
  2649.          test -f "$nlist" || : > "$nlist"
  2650.  
  2651. +        if test -n "$exclude_expsyms"; then
  2652. +          egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2653. +          $mv "$nlist"T "$nlist"
  2654. +        fi
  2655. +
  2656.          # Try sorting and uniquifying the output.
  2657. -        if sort "$nlist" | uniq > "$nlist"T; then
  2658. -          mv -f "$nlist"T "$nlist"
  2659. +        if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  2660. +          :
  2661.          else
  2662. -          $rm "$nlist"T
  2663. +          grep -v "^: " < "$nlist" > "$nlist"S
  2664.          fi
  2665.  
  2666. -        if test -f "$nlist"; then
  2667. -          sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
  2668. -          else
  2669. +        if test -f "$nlist"S; then
  2670. +          eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  2671. +        else
  2672.            echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2673. -          fi
  2674. +        fi
  2675.  
  2676.          $echo >> "$output_objdir/$dlsyms" "\
  2677.  
  2678. -#undef dld_preloaded_symbols
  2679. +#undef lt_preloaded_symbols
  2680.  
  2681.  #if defined (__STDC__) && __STDC__
  2682. -# define __ptr_t void *
  2683. +# define lt_ptr_t void *
  2684.  #else
  2685. -# define __ptr_t char *
  2686. +# define lt_ptr_t char *
  2687. +# define const
  2688.  #endif
  2689.  
  2690.  /* The mapping between symbol names and symbols. */
  2691. -struct {
  2692. -  char *name;
  2693. -  __ptr_t address;
  2694. +const struct {
  2695. +  const char *name;
  2696. +  lt_ptr_t address;
  2697.  }
  2698. -dld_preloaded_symbols[] =
  2699. +lt_preloaded_symbols[] =
  2700.  {\
  2701.  "
  2702.  
  2703. -            if test -n "$export_symbols"; then
  2704. -              echo >> "$objdir/$dlsyms" "\
  2705. -  {\"${output}\", (__ptr_t) 0},"
  2706. -          sed 's/^\(.*\)/  {"\1", (__ptr_t) \&\1},/' < "$export_symbols" >> "$objdir/$dlsyms"
  2707. -            fi
  2708. -
  2709. -            for arg in $dlprefiles; do
  2710. -          name=`echo "$arg" | sed -e 's%^.*/%%'`
  2711. -              echo >> "$objdir/$dlsyms" "\
  2712. -  {\"$name\", (__ptr_t) 0},"
  2713. -          eval "$NM $arg | $global_symbol_pipe > '$nlist'"
  2714. -
  2715. -          if test -f "$nlist"; then
  2716. -            sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
  2717. -          else
  2718. -        echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2719. -          fi
  2720. -
  2721. -            done
  2722. +        sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
  2723. +        -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
  2724. +          < "$nlist" >> "$output_objdir/$dlsyms"
  2725.  
  2726. -        if test -f "$nlist"; then
  2727. -          sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
  2728. -        fi
  2729. -
  2730.          $echo >> "$output_objdir/$dlsyms" "\
  2731. -  {0, (__ptr_t) 0}
  2732. +  {0, (lt_ptr_t) 0}
  2733.  };
  2734.  
  2735. +/* This works around a problem in FreeBSD linker */
  2736. +#ifdef FREEBSD_WORKAROUND
  2737. +static const void *lt_preloaded_setup() {
  2738. +  return lt_preloaded_symbols;
  2739. +}
  2740. +#endif
  2741. +
  2742.  #ifdef __cplusplus
  2743.  }
  2744.  #endif\
  2745.  "
  2746. -          fi
  2747. +      fi
  2748. +
  2749. +      pic_flag_for_symtable=
  2750. +      case "$host" in
  2751. +      # compiling the symbol table file with pic_flag works around
  2752. +      # a FreeBSD bug that causes programs to crash when -lm is
  2753. +      # linked before any other PIC object.  But we must not use
  2754. +      # pic_flag when linking with -static.  The problem exists in
  2755. +      # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2756. +      *-*-freebsd2*|*-*-freebsd3.0*)
  2757. +        case "$compile_command " in
  2758. +        *" -static "*) ;;
  2759. +        *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  2760. +        esac
  2761. +      esac
  2762.  
  2763. -          # Now compile the dynamic symbol file.
  2764. -          $show "(cd $objdir && $C_compiler -c$no_builtin_flag \"$dlsyms\")"
  2765. -          $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag "$dlsyms")' || exit $?
  2766. -
  2767. -          # Transform the symbol file into the correct name.
  2768. -          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  2769. -          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  2770. -      ;;
  2771. -        *)
  2772. -          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2773. -          exit 1
  2774. -          ;;
  2775. -        esac
  2776. -      elif test "$export_dynamic" != yes; then
  2777. -        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
  2778. +      # Now compile the dynamic symbol file.
  2779. +      $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  2780. +      $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  2781. +
  2782. +      # Clean up the generated files.
  2783. +      $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  2784. +      $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  2785. +
  2786. +      # Transform the symbol file into the correct name.
  2787. +      compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2788. +      finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2789. +      ;;
  2790. +    *)
  2791. +      $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2792. +      exit 1
  2793. +      ;;
  2794. +    esac
  2795.        else
  2796. -        # We keep going just in case the user didn't refer to
  2797. -        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
  2798. -        # really was required.
  2799. -        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2800. -
  2801. -        # Nullify the symbol file.
  2802. -        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2803. -        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2804. +    # We keep going just in case the user didn't refer to
  2805. +    # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  2806. +    # really was required.
  2807. +
  2808. +    # Nullify the symbol file.
  2809. +    compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2810. +    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2811.        fi
  2812.  
  2813.        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  2814. -        # Replace the output file specification.
  2815. -        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2816. -        finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2817. -
  2818. -        # We have no uninstalled library dependencies, so finalize right now.
  2819. -        $show "$compile_command"
  2820. -        $run eval "$compile_command"
  2821. -        exit $?
  2822. -      fi
  2823. -
  2824. -      # Replace the output file specification.
  2825. -      compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  2826. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
  2827. -
  2828. -      # Create the binary in the object directory, then wrap it.
  2829. -      if test ! -d $output_objdir; then
  2830. -        $show "$mkdir $output_objdir"
  2831. -    $run $mkdir $output_objdir
  2832. +    # Replace the output file specification.
  2833. +    compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2834. +    link_command="$compile_command$compile_rpath"
  2835. +
  2836. +    # We have no uninstalled library dependencies, so finalize right now.
  2837. +    $show "$link_command"
  2838. +    $run eval "$link_command"
  2839.      status=$?
  2840. -    if test $status -ne 0 && test ! -d $objdir; then
  2841. -      exit $status
  2842. +    
  2843. +    # Delete the generated files.
  2844. +    if test -n "$dlsyms"; then
  2845. +      $show "$rm $output_objdir/${outputname}S.${objext}"
  2846. +      $run $rm "$output_objdir/${outputname}S.${objext}"
  2847.      fi
  2848. +
  2849. +    exit $status
  2850.        fi
  2851.  
  2852.        if test -n "$shlibpath_var"; then
  2853. -        # We should set the shlibpath_var
  2854. -        rpath=
  2855. -        for dir in $temp_rpath; do
  2856. -          case "$dir" in
  2857. -          /* | [A-Za-z]:[/\\]*)
  2858. -            # Absolute path.
  2859. -            rpath="$rpath$dir:"
  2860. -            ;;
  2861. -          *)
  2862. -            # Relative path: add a thisdir entry.
  2863. -            rpath="$rpath\$thisdir/$dir:"
  2864. -            ;;
  2865. -          esac
  2866. -        done
  2867. -        temp_rpath="$rpath"
  2868. +    # We should set the shlibpath_var
  2869. +    rpath=
  2870. +    for dir in $temp_rpath; do
  2871. +      case "$dir" in
  2872. +      [\\/]* | [A-Za-z]:[\\/]*)
  2873. +        # Absolute path.
  2874. +        rpath="$rpath$dir:"
  2875. +        ;;
  2876. +      *)
  2877. +        # Relative path: add a thisdir entry.
  2878. +        rpath="$rpath\$thisdir/$dir:"
  2879. +        ;;
  2880. +      esac
  2881. +    done
  2882. +    temp_rpath="$rpath"
  2883.        fi
  2884.  
  2885. -      # Delete the old output file.
  2886. -      $run $rm $output
  2887. -
  2888. -      if test -n "$compile_shlibpath"; then
  2889. -        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
  2890. +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  2891. +    compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  2892.        fi
  2893.        if test -n "$finalize_shlibpath"; then
  2894. -        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  2895. +    finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  2896.        fi
  2897.  
  2898. -      if test -n "$runpath_var" && test -n "$perm_rpath"; then
  2899. -        # We should set the runpath_var.
  2900. -        rpath=
  2901. -        for dir in $perm_rpath; do
  2902. -          rpath="$rpath$dir:"
  2903. -        done
  2904. -        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
  2905. -        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
  2906. +      compile_var=
  2907. +      finalize_var=
  2908. +      if test -n "$runpath_var"; then
  2909. +    if test -n "$perm_rpath"; then
  2910. +      # We should set the runpath_var.
  2911. +      rpath=
  2912. +      for dir in $perm_rpath; do
  2913. +        rpath="$rpath$dir:"
  2914. +      done
  2915. +      compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2916. +    fi
  2917. +    if test -n "$finalize_perm_rpath"; then
  2918. +      # We should set the runpath_var.
  2919. +      rpath=
  2920. +      for dir in $finalize_perm_rpath; do
  2921. +        rpath="$rpath$dir:"
  2922. +      done
  2923. +      finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2924. +    fi
  2925.        fi
  2926.  
  2927.        if test "$hardcode_action" = relink; then
  2928. -        # AGH! Flame the AIX and HP-UX people for me, will ya?
  2929. -        $echo "$modename: warning: this platform doesn\'t like uninstalled shared libraries" 1>&2
  2930. -        $echo "$modename: \`$output' will be relinked during installation" 1>&2
  2931. +    # Fast installation is not supported
  2932. +    link_command="$compile_var$compile_command$compile_rpath"
  2933. +    relink_command="$finalize_var$finalize_command$finalize_rpath"
  2934. +    
  2935. +    $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  2936. +    $echo "$modename: \`$output' will be relinked during installation" 1>&2
  2937. +      else
  2938. +    if test "$fast_install" != no; then
  2939. +      link_command="$finalize_var$compile_command$finalize_rpath"
  2940. +      if test "$fast_install" = yes; then
  2941. +        relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  2942. +      else
  2943. +        # fast_install is set to needless
  2944. +        relink_command=
  2945. +      fi
  2946. +    else
  2947. +      link_command="$compile_var$compile_command$compile_rpath"
  2948. +      relink_command="$finalize_var$finalize_command$finalize_rpath"
  2949. +    fi
  2950.        fi
  2951.  
  2952. -      $show "$compile_command"
  2953. -      $run eval "$compile_command" || exit $?
  2954. +      # Replace the output file specification.
  2955. +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  2956. +      
  2957. +      # Delete the old output files.
  2958. +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  2959. +
  2960. +      $show "$link_command"
  2961. +      $run eval "$link_command" || exit $?
  2962.  
  2963.        # Now create the wrapper script.
  2964.        $show "creating $output"
  2965.  
  2966. -      # Quote the finalize command for shipping.
  2967. -      finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
  2968. +      # Quote the relink command for shipping.
  2969. +      if test -n "$relink_command"; then
  2970. +    relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  2971. +      fi
  2972.  
  2973.        # Quote $echo for shipping.
  2974.        if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  2975.      case "$0" in
  2976. -    /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";;
  2977. +    [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  2978.      *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  2979.      esac
  2980.      qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  2981.        else
  2982. -        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  2983. +    qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  2984.        fi
  2985.  
  2986.        # Only actually do things if our run command is non-null.
  2987.        if test -z "$run"; then
  2988. -        $rm $output
  2989. -        trap "$rm $output; exit 1" 1 2 15
  2990. +    # win32 will think the script is a binary if it has
  2991. +    # a .exe suffix, so we strip it off here.
  2992. +    case $output in
  2993. +      *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  2994. +    esac
  2995. +    $rm $output
  2996. +    trap "$rm $output; exit 1" 1 2 15
  2997.  
  2998. -        $echo > $output "\
  2999. +    $echo > $output "\
  3000.  #! $SHELL
  3001.  
  3002.  # $output - temporary wrapper script for $objdir/$outputname
  3003. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION
  3004. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3005.  #
  3006.  # The $output program cannot be directly executed until all the libtool
  3007.  # libraries that it depends on are installed.
  3008. @@ -1998,7 +2682,7 @@
  3009.  
  3010.  # Sed substitution that helps us do robust quoting.  It backslashifies
  3011.  # metacharacters that are still active within double-quoted strings.
  3012. -Xsed='sed -e s/^X//'
  3013. +Xsed='sed -e 1s/^X//'
  3014.  sed_quote_subst='$sed_quote_subst'
  3015.  
  3016.  # The HP-UX ksh and POSIX shell print the target directory to stdout
  3017. @@ -2005,11 +2689,12 @@
  3018.  # if CDPATH is set.
  3019.  if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
  3020.  
  3021. +relink_command=\"$relink_command\"
  3022. +
  3023.  # This environment variable determines our operation mode.
  3024.  if test \"\$libtool_install_magic\" = \"$magic\"; then
  3025. -  # install mode needs the following variables:
  3026. +  # install mode needs the following variable:
  3027.    link_against_libtool_libs='$link_against_libtool_libs'
  3028. -  finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\"
  3029.  else
  3030.    # When we are sourced in execute mode, \$file and \$echo are already set.
  3031.    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3032. @@ -2028,7 +2713,7 @@
  3033.      fi
  3034.    fi\
  3035.  "
  3036. -        $echo >> $output "\
  3037. +    $echo >> $output "\
  3038.  
  3039.    # Find the directory that this script lives in.
  3040.    thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3041. @@ -2042,7 +2727,7 @@
  3042.      # If there was a directory component, then change thisdir.
  3043.      if test \"x\$destdir\" != \"x\$file\"; then
  3044.        case \"\$destdir\" in
  3045. -      /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
  3046. +      [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
  3047.        *) thisdir=\"\$thisdir/\$destdir\" ;;
  3048.        esac
  3049.      fi
  3050. @@ -2054,35 +2739,97 @@
  3051.    # Try to get the absolute directory name.
  3052.    absdir=\`cd \"\$thisdir\" && pwd\`
  3053.    test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3054. +"
  3055.  
  3056. +    if test "$fast_install" = yes; then
  3057. +      echo >> $output "\
  3058. +  program=lt-'$outputname'
  3059.    progdir=\"\$thisdir/$objdir\"
  3060. +  
  3061. +  if test ! -f \"\$progdir/\$program\" || \\
  3062. +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  3063. +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3064. +
  3065. +    file=\"\$\$-\$program\"
  3066. +
  3067. +    if test ! -d \"\$progdir\"; then
  3068. +      $mkdir \"\$progdir\"
  3069. +    else
  3070. +      $rm \"\$progdir/\$file\"
  3071. +    fi"
  3072. +
  3073. +      echo >> $output "\
  3074. +
  3075. +    # relink executable if necessary
  3076. +    if test -n \"\$relink_command\"; then
  3077. +      if (cd \"\$thisdir\" && eval \$relink_command); then :
  3078. +      else
  3079. +    $rm \"\$progdir/\$file\"
  3080. +    exit 1
  3081. +      fi
  3082. +    fi
  3083. +
  3084. +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3085. +    { $rm \"\$progdir/\$program\";
  3086. +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3087. +    $rm \"\$progdir/\$file\"
  3088. +  fi"
  3089. +    else
  3090. +      echo >> $output "\
  3091.    program='$outputname'
  3092. +  progdir=\"\$thisdir/$objdir\"
  3093. +"
  3094. +    fi
  3095.  
  3096. +    echo >> $output "\
  3097. +
  3098.    if test -f \"\$progdir/\$program\"; then"
  3099.  
  3100. -        # Export our shlibpath_var if we have one.
  3101. -        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3102. -          $echo >> $output "\
  3103. +    # Export our shlibpath_var if we have one.
  3104. +    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3105. +      $echo >> $output "\
  3106.      # Add our own library path to $shlibpath_var
  3107.      $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3108.  
  3109.      # Some systems cannot cope with colon-terminated $shlibpath_var
  3110. -    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
  3111. +    # The second colon is a workaround for a bug in BeOS R4 sed
  3112. +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3113.  
  3114.      export $shlibpath_var
  3115.  "
  3116. -        fi
  3117. +    fi
  3118. +
  3119. +    # fixup the dll searchpath if we need to.
  3120. +    if test -n "$dllsearchpath"; then
  3121. +      $echo >> $output "\
  3122. +    # Add the dll search path components to the executable PATH
  3123. +    PATH=$dllsearchpath:\$PATH
  3124. +"
  3125. +    fi
  3126.  
  3127. -        $echo >> $output "\
  3128. +    $echo >> $output "\
  3129.      if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3130.        # Run the actual program with our arguments.
  3131. -
  3132. +"
  3133. +    case $host in
  3134. +    *-*-cygwin* | *-*-mingw | *-*-os2*)
  3135. +      # win32 systems need to use the prog path for dll
  3136. +      # lookup to work
  3137. +      $echo >> $output "\
  3138. +      exec \$progdir\\\\\$program \${1+\"\$@\"}
  3139. +"
  3140. +      ;;
  3141. +    *)
  3142. +      $echo >> $output "\
  3143.        # Export the path to the program.
  3144.        PATH=\"\$progdir:\$PATH\"
  3145.        export PATH
  3146.  
  3147.        exec \$program \${1+\"\$@\"}
  3148. -
  3149. +"
  3150. +      ;;
  3151. +    esac
  3152. +    $echo >> $output "\
  3153.        \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3154.        exit 1
  3155.      fi
  3156. @@ -2095,7 +2842,7 @@
  3157.    fi
  3158.  fi\
  3159.  "
  3160. -        chmod +x $output
  3161. +    chmod +x $output
  3162.        fi
  3163.        exit 0
  3164.        ;;
  3165. @@ -2105,46 +2852,78 @@
  3166.      for oldlib in $oldlibs; do
  3167.  
  3168.        if test "$build_libtool_libs" = convenience; then
  3169. -    oldobjs="$libobjs"
  3170. +    oldobjs="$libobjs_save"
  3171.      addlibs="$convenience"
  3172.      build_libtool_libs=no
  3173.        else
  3174. -    oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.'${libext}' //g' -e 's/[^   ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
  3175. +    if test "$build_libtool_libs" = module; then
  3176. +      oldobjs="$libobjs_save"
  3177. +      build_libtool_libs=no
  3178. +    else
  3179. +      oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  3180. +    fi
  3181.      addlibs="$old_convenience"
  3182.        fi
  3183.  
  3184. -      # Add in members from convenience archives.
  3185. -      for xlib in $addlibs; do
  3186. -    # Extract the objects.
  3187. -    xdir="$xlib"x
  3188. -    generated="$generated $xdir"
  3189. -    xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
  3190. -
  3191. -    $show "${rm}r $xdir"
  3192. -    $run ${rm}r "$xdir"
  3193. -    $show "mkdir $xdir"
  3194. -    $run mkdir "$xdir"
  3195. +      if test -n "$addlibs"; then
  3196. +    gentop="$output_objdir/${outputname}x"
  3197. +    $show "${rm}r $gentop"
  3198. +    $run ${rm}r "$gentop"
  3199. +    $show "mkdir $gentop"
  3200. +    $run mkdir "$gentop"
  3201.      status=$?
  3202. -    if test $status -ne 0 && test ! -d "$xdir"; then
  3203. +    if test $status -ne 0 && test ! -d "$gentop"; then
  3204.        exit $status
  3205.      fi
  3206. -    $show "(cd $xdir && $AR x ../$xlib)"
  3207. -    $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  3208. +    generated="$generated $gentop"
  3209. +      
  3210. +    # Add in members from convenience archives.
  3211. +    for xlib in $addlibs; do
  3212. +      # Extract the objects.
  3213. +      case "$xlib" in
  3214. +      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3215. +      *) xabs=`pwd`"/$xlib" ;;
  3216. +      esac
  3217. +      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3218. +      xdir="$gentop/$xlib"
  3219.  
  3220. -    oldobjs="$oldobjs `echo $xdir/*`"
  3221. -      done
  3222. +      $show "${rm}r $xdir"
  3223. +      $run ${rm}r "$xdir"
  3224. +      $show "mkdir $xdir"
  3225. +      $run mkdir "$xdir"
  3226. +      status=$?
  3227. +      if test $status -ne 0 && test ! -d "$xdir"; then
  3228. +        exit $status
  3229. +      fi
  3230. +      $show "(cd $xdir && $AR x $xabs)"
  3231. +      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3232. +
  3233. +      oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  3234. +    done
  3235. +      fi
  3236.  
  3237.        # Do each command in the archive commands.
  3238.        if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3239.      eval cmds=\"$old_archive_from_new_cmds\"
  3240.        else
  3241. +    # Ensure that we have .o objects in place incase we decided
  3242. +    # not to build a shared library, and have fallen back to building
  3243. +    # static libs even though --disable-static was passed!
  3244. +    for oldobj in $oldobjs; do
  3245. +      if test ! -f $oldobj; then
  3246. +        obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
  3247. +        $show "${LN_S} $obj $oldobj"
  3248. +        $run ${LN_S} $obj $oldobj || exit $?
  3249. +      fi
  3250. +    done
  3251. +
  3252.      eval cmds=\"$old_archive_cmds\"
  3253.        fi
  3254.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3255.        for cmd in $cmds; do
  3256. -        IFS="$save_ifs"
  3257. -        $show "$cmd"
  3258. -        $run eval "$cmd" || exit $?
  3259. +    IFS="$save_ifs"
  3260. +    $show "$cmd"
  3261. +    $run eval "$cmd" || exit $?
  3262.        done
  3263.        IFS="$save_ifs"
  3264.      done
  3265. @@ -2161,11 +2940,30 @@
  3266.        test "$build_old_libs" = yes && old_library="$libname.$libext"
  3267.        $show "creating $output"
  3268.  
  3269. +      if test -n "$xrpath"; then
  3270. +    temp_xrpath=
  3271. +    for libdir in $xrpath; do
  3272. +      temp_xrpath="$temp_xrpath -R$libdir"
  3273. +    done
  3274. +    dependency_libs="$temp_xrpath $dependency_libs"
  3275. +      fi
  3276. +
  3277.        # Only create the output if not a dry run.
  3278.        if test -z "$run"; then
  3279. -        $echo > $output "\
  3280. -# $output - a libtool library file
  3281. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION
  3282. +    for installed in no yes; do
  3283. +      if test "$installed" = yes; then
  3284. +        if test -z "$install_libdir"; then
  3285. +          break
  3286. +        fi
  3287. +        output="$output_objdir/$outputname"i
  3288. +      fi
  3289. +      $rm $output
  3290. +      $echo > $output "\
  3291. +# $outputname - a libtool library file
  3292. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3293. +#
  3294. +# Please DO NOT delete this file!
  3295. +# It is necessary for linking the library.
  3296.  
  3297.  # The name that we can dlopen(3).
  3298.  dlname='$dlname'
  3299. @@ -2185,17 +2983,18 @@
  3300.  revision=$revision
  3301.  
  3302.  # Is this an already installed library?
  3303. -installed=no
  3304. +installed=$installed
  3305.  
  3306.  # Directory that this library needs to be installed in:
  3307.  libdir='$install_libdir'\
  3308.  "
  3309. +    done
  3310.        fi
  3311.  
  3312.        # Do a symbolic link so that the libtool archive can be found in
  3313.        # LD_LIBRARY_PATH before the program is installed.
  3314. -      $show "(cd $output_objdir && $LN_S ../$outputname $outputname)"
  3315. -      $run eval "(cd $output_objdir && $LN_S ../$outputname $outputname)" || exit $?
  3316. +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  3317. +      $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  3318.        ;;
  3319.      esac
  3320.      exit 0
  3321. @@ -2244,9 +3043,9 @@
  3322.      for arg
  3323.      do
  3324.        if test -n "$dest"; then
  3325. -        files="$files $dest"
  3326. -        dest="$arg"
  3327. -        continue
  3328. +    files="$files $dest"
  3329. +    dest="$arg"
  3330. +    continue
  3331.        fi
  3332.  
  3333.        case "$arg" in
  3334. @@ -2256,20 +3055,20 @@
  3335.        -m) prev="-m" ;;
  3336.        -o) prev="-o" ;;
  3337.        -s)
  3338. -        stripme=" -s"
  3339. -        continue
  3340. -        ;;
  3341. +    stripme=" -s"
  3342. +    continue
  3343. +    ;;
  3344.        -*) ;;
  3345.  
  3346.        *)
  3347. -        # If the previous option needed an argument, then skip it.
  3348. -        if test -n "$prev"; then
  3349. -          prev=
  3350. -        else
  3351. -          dest="$arg"
  3352. -          continue
  3353. -        fi
  3354. -        ;;
  3355. +    # If the previous option needed an argument, then skip it.
  3356. +    if test -n "$prev"; then
  3357. +      prev=
  3358. +    else
  3359. +      dest="$arg"
  3360. +      continue
  3361. +    fi
  3362. +    ;;
  3363.        esac
  3364.  
  3365.        # Aesthetically quote the argument.
  3366. @@ -2296,9 +3095,9 @@
  3367.  
  3368.      if test -z "$files"; then
  3369.        if test -z "$dest"; then
  3370. -        $echo "$modename: no file or destination specified" 1>&2
  3371. +    $echo "$modename: no file or destination specified" 1>&2
  3372.        else
  3373. -        $echo "$modename: you must specify a destination" 1>&2
  3374. +    $echo "$modename: you must specify a destination" 1>&2
  3375.        fi
  3376.        $echo "$help" 1>&2
  3377.        exit 1
  3378. @@ -2320,23 +3119,23 @@
  3379.        # Not a directory, so check to see that there is only one file specified.
  3380.        set dummy $files
  3381.        if test $# -gt 2; then
  3382. -        $echo "$modename: \`$dest' is not a directory" 1>&2
  3383. -        $echo "$help" 1>&2
  3384. -        exit 1
  3385. +    $echo "$modename: \`$dest' is not a directory" 1>&2
  3386. +    $echo "$help" 1>&2
  3387. +    exit 1
  3388.        fi
  3389.      fi
  3390.      case "$destdir" in
  3391. -    /* | [A-Za-z]:[/\\]*) ;;
  3392. +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  3393.      *)
  3394.        for file in $files; do
  3395. -        case "$file" in
  3396. -        *.lo) ;;
  3397. -        *)
  3398. -          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3399. -          $echo "$help" 1>&2
  3400. -          exit 1
  3401. -          ;;
  3402. -        esac
  3403. +    case "$file" in
  3404. +    *.lo) ;;
  3405. +    *)
  3406. +      $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3407. +      $echo "$help" 1>&2
  3408. +      exit 1
  3409. +      ;;
  3410. +    esac
  3411.        done
  3412.        ;;
  3413.      esac
  3414. @@ -2353,212 +3152,221 @@
  3415.        # Do each installation.
  3416.        case "$file" in
  3417.        *.a | *.lib)
  3418. -        # Do the static libraries later.
  3419. -        staticlibs="$staticlibs $file"
  3420. -        ;;
  3421. +    # Do the static libraries later.
  3422. +    staticlibs="$staticlibs $file"
  3423. +    ;;
  3424.  
  3425.        *.la)
  3426. -        # Check to see that this really is a libtool archive.
  3427. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3428. -        else
  3429. -          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3430. -          $echo "$help" 1>&2
  3431. -          exit 1
  3432. -        fi
  3433. -
  3434. -        library_names=
  3435. -        old_library=
  3436. -        # If there is no directory component, then add one.
  3437. -        case "$file" in
  3438. -        */* | *\\*) . $file ;;
  3439. -        *) . ./$file ;;
  3440. -        esac
  3441. -
  3442. -        # Add the libdir to current_libdirs if it is the destination.
  3443. -        if test "X$destdir" = "X$libdir"; then
  3444. -          case "$current_libdirs " in
  3445. -          *" $libdir "*) ;;
  3446. -          *) current_libdirs="$current_libdirs $libdir" ;;
  3447. -          esac
  3448. -        else
  3449. -          # Note the libdir as a future libdir.
  3450. -          case "$future_libdirs " in
  3451. -          *" $libdir "*) ;;
  3452. -          *) future_libdirs="$future_libdirs $libdir" ;;
  3453. -          esac
  3454. -        fi
  3455. -
  3456. -        dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3457. -        test "X$dir" = "X$file/" && dir=
  3458. -        dir="$dir$objdir"
  3459. -
  3460. -        # See the names of the shared library.
  3461. -        set dummy $library_names
  3462. -        if test -n "$2"; then
  3463. -          realname="$2"
  3464. -          shift
  3465. -          shift
  3466. -
  3467. -          # Install the shared library and build the symlinks.
  3468. -          $show "$install_prog $dir/$realname $destdir/$realname"
  3469. -          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3470. -          test "X$dlname" = "X$realname" && dlname=
  3471. -
  3472. -          if test $# -gt 0; then
  3473. -            # Delete the old symlinks, and create new ones.
  3474. -            for linkname
  3475. -            do
  3476. -              test "X$dlname" = "X$linkname" && dlname=
  3477. +    # Check to see that this really is a libtool archive.
  3478. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3479. +    else
  3480. +      $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3481. +      $echo "$help" 1>&2
  3482. +      exit 1
  3483. +    fi
  3484. +
  3485. +    library_names=
  3486. +    old_library=
  3487. +    # If there is no directory component, then add one.
  3488. +    case "$file" in
  3489. +    */* | *\\*) . $file ;;
  3490. +    *) . ./$file ;;
  3491. +    esac
  3492. +
  3493. +    # Add the libdir to current_libdirs if it is the destination.
  3494. +    if test "X$destdir" = "X$libdir"; then
  3495. +      case "$current_libdirs " in
  3496. +      *" $libdir "*) ;;
  3497. +      *) current_libdirs="$current_libdirs $libdir" ;;
  3498. +      esac
  3499. +    else
  3500. +      # Note the libdir as a future libdir.
  3501. +      case "$future_libdirs " in
  3502. +      *" $libdir "*) ;;
  3503. +      *) future_libdirs="$future_libdirs $libdir" ;;
  3504. +      esac
  3505. +    fi
  3506. +
  3507. +    dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3508. +    test "X$dir" = "X$file/" && dir=
  3509. +    dir="$dir$objdir"
  3510. +
  3511. +    # See the names of the shared library.
  3512. +    set dummy $library_names
  3513. +    if test -n "$2"; then
  3514. +      realname="$2"
  3515. +      shift
  3516. +      shift
  3517. +
  3518. +      # Install the shared library and build the symlinks.
  3519. +      $show "$install_prog $dir/$realname $destdir/$realname"
  3520. +      $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3521. +      test "X$dlname" = "X$realname" && dlname=
  3522. +
  3523. +      if test $# -gt 0; then
  3524. +        # Delete the old symlinks, and create new ones.
  3525. +        for linkname
  3526. +        do
  3527. +          test "X$dlname" = "X$linkname" && dlname=
  3528.            if test "$linkname" != "$realname"; then
  3529.          $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3530.          $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3531.            fi
  3532. -            done
  3533. -          fi
  3534. +        done
  3535. +      fi
  3536.  
  3537. -          if test -n "$dlname"; then
  3538. -            # Install the dynamically-loadable library.
  3539. -            $show "$install_prog $dir/$dlname $destdir/$dlname"
  3540. -            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3541. -          fi
  3542. -
  3543. -          # Do each command in the postinstall commands.
  3544. -          lib="$destdir/$realname"
  3545. -          eval cmds=\"$postinstall_cmds\"
  3546. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3547. -          for cmd in $cmds; do
  3548. -            IFS="$save_ifs"
  3549. -            $show "$cmd"
  3550. -            $run eval "$cmd" || exit $?
  3551. -          done
  3552. -          IFS="$save_ifs"
  3553. -        fi
  3554. +      if test -n "$dlname"; then
  3555. +        # Install the dynamically-loadable library.
  3556. +        $show "$install_prog $dir/$dlname $destdir/$dlname"
  3557. +        $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3558. +      fi
  3559. +
  3560. +      # Do each command in the postinstall commands.
  3561. +      lib="$destdir/$realname"
  3562. +      eval cmds=\"$postinstall_cmds\"
  3563. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3564. +      for cmd in $cmds; do
  3565. +        IFS="$save_ifs"
  3566. +        $show "$cmd"
  3567. +        $run eval "$cmd" || exit $?
  3568. +      done
  3569. +      IFS="$save_ifs"
  3570. +    fi
  3571.  
  3572. -        # Install the pseudo-library for information purposes.
  3573. -        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3574. +    # Install the pseudo-library for information purposes.
  3575. +    name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3576.      instname="$dir/$name"i
  3577. -    $show "Creating $instname"
  3578. -    $rm "$instname"
  3579. -    sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
  3580. -        $show "$install_prog $instname $destdir/$name"
  3581. -        $run eval "$install_prog $instname $destdir/$name" || exit $?
  3582. -    $show "$rm $instname"
  3583. -    $rm "$instname"
  3584. -
  3585. -        # Maybe install the static library, too.
  3586. -        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3587. -        ;;
  3588. +    $show "$install_prog $instname $destdir/$name"
  3589. +    $run eval "$install_prog $instname $destdir/$name" || exit $?
  3590. +
  3591. +    # Maybe install the static library, too.
  3592. +    test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3593. +    ;;
  3594.  
  3595.        *.lo)
  3596. -        # Install (i.e. copy) a libtool object.
  3597. +    # Install (i.e. copy) a libtool object.
  3598. +
  3599. +    # Figure out destination file name, if it wasn't already specified.
  3600. +    if test -n "$destname"; then
  3601. +      destfile="$destdir/$destname"
  3602. +    else
  3603. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3604. +      destfile="$destdir/$destfile"
  3605. +    fi
  3606. +
  3607. +    # Deduce the name of the destination old-style object file.
  3608. +    case "$destfile" in
  3609. +    *.lo)
  3610. +      staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3611. +      ;;
  3612. +    *.o | *.obj)
  3613. +      staticdest="$destfile"
  3614. +      destfile=
  3615. +      ;;
  3616. +    *)
  3617. +      $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3618. +      $echo "$help" 1>&2
  3619. +      exit 1
  3620. +      ;;
  3621. +    esac
  3622.  
  3623. -        # Figure out destination file name, if it wasn't already specified.
  3624. -        if test -n "$destname"; then
  3625. -          destfile="$destdir/$destname"
  3626. -        else
  3627. -          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3628. -          destfile="$destdir/$destfile"
  3629. -        fi
  3630. -
  3631. -        # Deduce the name of the destination old-style object file.
  3632. -        case "$destfile" in
  3633. -        *.lo)
  3634. -          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3635. -          ;;
  3636. -        *.o | *.obj)
  3637. -          staticdest="$destfile"
  3638. -          destfile=
  3639. -          ;;
  3640. -        *)
  3641. -          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3642. -          $echo "$help" 1>&2
  3643. -          exit 1
  3644. -          ;;
  3645. -        esac
  3646. -
  3647. -        # Install the libtool object if requested.
  3648. -        if test -n "$destfile"; then
  3649. -          $show "$install_prog $file $destfile"
  3650. -          $run eval "$install_prog $file $destfile" || exit $?
  3651. -        fi
  3652. -
  3653. -        # Install the old object if enabled.
  3654. -        if test "$build_old_libs" = yes; then
  3655. -          # Deduce the name of the old-style object file.
  3656. -          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3657. -
  3658. -          $show "$install_prog $staticobj $staticdest"
  3659. -          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3660. -        fi
  3661. -        exit 0
  3662. -        ;;
  3663. +    # Install the libtool object if requested.
  3664. +    if test -n "$destfile"; then
  3665. +      $show "$install_prog $file $destfile"
  3666. +      $run eval "$install_prog $file $destfile" || exit $?
  3667. +    fi
  3668. +
  3669. +    # Install the old object if enabled.
  3670. +    if test "$build_old_libs" = yes; then
  3671. +      # Deduce the name of the old-style object file.
  3672. +      staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3673. +
  3674. +      $show "$install_prog $staticobj $staticdest"
  3675. +      $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3676. +    fi
  3677. +    exit 0
  3678. +    ;;
  3679.  
  3680.        *)
  3681. -        # Figure out destination file name, if it wasn't already specified.
  3682. -        if test -n "$destname"; then
  3683. -          destfile="$destdir/$destname"
  3684. -        else
  3685. -          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3686. -          destfile="$destdir/$destfile"
  3687. -        fi
  3688. -
  3689. -        # Do a test to see if this is really a libtool program.
  3690. -        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3691. -          link_against_libtool_libs=
  3692. -          finalize_command=
  3693. -
  3694. -          # If there is no directory component, then add one.
  3695. -          case "$file" in
  3696. -          */* | *\\*) . $file ;;
  3697. -          *) . ./$file ;;
  3698. -          esac
  3699. -
  3700. -          # Check the variables that should have been set.
  3701. -          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
  3702. -            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3703. -            exit 1
  3704. -          fi
  3705. -
  3706. -          finalize=yes
  3707. -          for lib in $link_against_libtool_libs; do
  3708. -            # Check to see that each library is installed.
  3709. -            libdir=
  3710. -            if test -f "$lib"; then
  3711. -              # If there is no directory component, then add one.
  3712. -              case "$lib" in
  3713. -              */* | *\\*) . $lib ;;
  3714. -              *) . ./$lib ;;
  3715. -              esac
  3716. -            fi
  3717. -            libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  3718. -            if test -n "$libdir" && test ! -f "$libfile"; then
  3719. -              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  3720. -              finalize=no
  3721. -            fi
  3722. -          done
  3723. -
  3724. -          if test "$hardcode_action" = relink; then
  3725. -            if test "$finalize" = yes; then
  3726. -              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
  3727. -              $show "$finalize_command"
  3728. -              if $run eval "$finalize_command"; then :
  3729. -              else
  3730. -                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3731. -                continue
  3732. -              fi
  3733. -              file="$objdir/$file"T
  3734. -            else
  3735. -              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
  3736. -            fi
  3737. -          else
  3738. -            # Install the binary that we compiled earlier.
  3739. +    # Figure out destination file name, if it wasn't already specified.
  3740. +    if test -n "$destname"; then
  3741. +      destfile="$destdir/$destname"
  3742. +    else
  3743. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3744. +      destfile="$destdir/$destfile"
  3745. +    fi
  3746. +
  3747. +    # Do a test to see if this is really a libtool program.
  3748. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3749. +      link_against_libtool_libs=
  3750. +      relink_command=
  3751. +
  3752. +      # If there is no directory component, then add one.
  3753. +      case "$file" in
  3754. +      */* | *\\*) . $file ;;
  3755. +      *) . ./$file ;;
  3756. +      esac
  3757. +
  3758. +      # Check the variables that should have been set.
  3759. +      if test -z "$link_against_libtool_libs"; then
  3760. +        $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3761. +        exit 1
  3762. +      fi
  3763. +
  3764. +      finalize=yes
  3765. +      for lib in $link_against_libtool_libs; do
  3766. +        # Check to see that each library is installed.
  3767. +        libdir=
  3768. +        if test -f "$lib"; then
  3769. +          # If there is no directory component, then add one.
  3770. +          case "$lib" in
  3771. +          */* | *\\*) . $lib ;;
  3772. +          *) . ./$lib ;;
  3773. +          esac
  3774. +        fi
  3775. +        libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  3776. +        if test -n "$libdir" && test ! -f "$libfile"; then
  3777. +          $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  3778. +          finalize=no
  3779. +        fi
  3780. +      done
  3781. +
  3782. +      outputname=
  3783. +      if test "$fast_install" = no && test -n "$relink_command"; then
  3784. +        if test "$finalize" = yes && test -z "$run"; then
  3785. +          tmpdir="/tmp"
  3786. +          test -n "$TMPDIR" && tmpdir="$TMPDIR"
  3787. +          tmpdir="$tmpdir/libtool-$$"
  3788. +          if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  3789. +          else
  3790. +        $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  3791. +        continue
  3792. +          fi
  3793. +          outputname="$tmpdir/$file"
  3794. +          # Replace the output file specification.
  3795. +          relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  3796. +
  3797. +          $show "$relink_command"
  3798. +          if $run eval "$relink_command"; then :
  3799. +          else
  3800. +        $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3801. +        ${rm}r "$tmpdir"
  3802. +        continue
  3803. +          fi
  3804. +          file="$outputname"
  3805. +        else
  3806. +          $echo "$modename: warning: cannot relink \`$file'" 1>&2
  3807. +        fi
  3808. +      else
  3809. +        # Install the binary that we compiled earlier.
  3810.          file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  3811. -          fi
  3812. -        fi
  3813. +      fi
  3814. +    fi
  3815.  
  3816. -        $show "$install_prog$stripme $file $destfile"
  3817. -        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  3818. -        ;;
  3819. +    $show "$install_prog$stripme $file $destfile"
  3820. +    $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  3821. +    test -n "$outputname" && ${rm}r "$tmpdir"
  3822. +    ;;
  3823.        esac
  3824.      done
  3825.  
  3826. @@ -2575,9 +3383,9 @@
  3827.        eval cmds=\"$old_postinstall_cmds\"
  3828.        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3829.        for cmd in $cmds; do
  3830. -        IFS="$save_ifs"
  3831. -        $show "$cmd"
  3832. -        $run eval "$cmd" || exit $?
  3833. +    IFS="$save_ifs"
  3834. +    $show "$cmd"
  3835. +    $run eval "$cmd" || exit $?
  3836.        done
  3837.        IFS="$save_ifs"
  3838.      done
  3839. @@ -2605,7 +3413,7 @@
  3840.      if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3841.        for dir
  3842.        do
  3843. -        libdirs="$libdirs $dir"
  3844. +    libdirs="$libdirs $dir"
  3845.        done
  3846.  
  3847.        for libdir in $libdirs; do
  3848. @@ -2612,14 +3420,14 @@
  3849.      if test -n "$finish_cmds"; then
  3850.        # Do each command in the finish commands.
  3851.        eval cmds=\"$finish_cmds\"
  3852. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3853. -          for cmd in $cmds; do
  3854. -            IFS="$save_ifs"
  3855. -            $show "$cmd"
  3856. -            $run eval "$cmd" || admincmds="$admincmds
  3857. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3858. +      for cmd in $cmds; do
  3859. +        IFS="$save_ifs"
  3860. +        $show "$cmd"
  3861. +        $run eval "$cmd" || admincmds="$admincmds
  3862.         $cmd"
  3863. -          done
  3864. -          IFS="$save_ifs"
  3865. +      done
  3866. +      IFS="$save_ifs"
  3867.      fi
  3868.      if test -n "$finish_eval"; then
  3869.        # Do the single finish_eval.
  3870. @@ -2639,10 +3447,10 @@
  3871.        echo "   $libdir"
  3872.      done
  3873.      echo
  3874. -    echo "To link against installed libraries in a given directory, LIBDIR,"
  3875. -    echo "you must use the \`-LLIBDIR' flag during linking."
  3876. -    echo
  3877. -    echo " You will also need to do at least one of the following:"
  3878. +    echo "If you ever happen to want to link against installed libraries"
  3879. +    echo "in a given directory, LIBDIR, you must either use libtool, and"
  3880. +    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  3881. +    echo "flag during linking and do at least one of the following:"
  3882.      if test -n "$shlibpath_var"; then
  3883.        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  3884.        echo "     during execution"
  3885. @@ -2693,22 +3501,22 @@
  3886.        dir=
  3887.        case "$file" in
  3888.        *.la)
  3889. -        # Check to see that this really is a libtool archive.
  3890. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3891. -        else
  3892. -          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3893. -          $echo "$help" 1>&2
  3894. -          exit 1
  3895. -        fi
  3896. +    # Check to see that this really is a libtool archive.
  3897. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3898. +    else
  3899. +      $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3900. +      $echo "$help" 1>&2
  3901. +      exit 1
  3902. +    fi
  3903.  
  3904.      # Read the libtool library.
  3905.      dlname=
  3906.      library_names=
  3907.  
  3908. -        # If there is no directory component, then add one.
  3909. +    # If there is no directory component, then add one.
  3910.      case "$file" in
  3911.      */* | *\\*) . $file ;;
  3912. -        *) . ./$file ;;
  3913. +    *) . ./$file ;;
  3914.      esac
  3915.  
  3916.      # Skip this library if it cannot be dlopened.
  3917. @@ -2737,7 +3545,7 @@
  3918.  
  3919.        *)
  3920.      $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  3921. -        continue
  3922. +    continue
  3923.      ;;
  3924.        esac
  3925.  
  3926. @@ -2764,8 +3572,8 @@
  3927.        case "$file" in
  3928.        -*) ;;
  3929.        *)
  3930. -        # Do a test to see if this is really a libtool program.
  3931. -        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3932. +    # Do a test to see if this is really a libtool program.
  3933. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3934.        # If there is no directory component, then add one.
  3935.        case "$file" in
  3936.        */* | *\\*) . $file ;;
  3937. @@ -2775,7 +3583,7 @@
  3938.        # Transform arg to wrapped name.
  3939.        file="$progdir/$program"
  3940.      fi
  3941. -        ;;
  3942. +    ;;
  3943.        esac
  3944.        # Quote arguments (to preserve shell metacharacters).
  3945.        file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  3946. @@ -2788,10 +3596,10 @@
  3947.  
  3948.        # Restore saved enviroment variables
  3949.        if test "${save_LC_ALL+set}" = set; then
  3950. -        LC_ALL="$save_LC_ALL"; export LC_ALL
  3951. +    LC_ALL="$save_LC_ALL"; export LC_ALL
  3952.        fi
  3953.        if test "${save_LANG+set}" = set; then
  3954. -        LANG="$save_LANG"; export LANG
  3955. +    LANG="$save_LANG"; export LANG
  3956.        fi
  3957.  
  3958.        # Now actually exec the command.
  3959. @@ -2837,17 +3645,17 @@
  3960.  
  3961.        case "$name" in
  3962.        *.la)
  3963. -        # Possibly a libtool archive, so verify it.
  3964. -        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3965. -          . $dir/$name
  3966. -
  3967. -          # Delete the libtool libraries and symlinks.
  3968. -          for n in $library_names; do
  3969. -            rmfiles="$rmfiles $dir/$n"
  3970. -            test "X$n" = "X$dlname" && dlname=
  3971. -          done
  3972. -          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  3973. -          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  3974. +    # Possibly a libtool archive, so verify it.
  3975. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3976. +      . $dir/$name
  3977. +
  3978. +      # Delete the libtool libraries and symlinks.
  3979. +      for n in $library_names; do
  3980. +        rmfiles="$rmfiles $dir/$n"
  3981. +        test "X$n" = "X$dlname" && dlname=
  3982. +      done
  3983. +      test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  3984. +      test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  3985.  
  3986.        $show "$rm $rmfiles"
  3987.        $run $rm $rmfiles
  3988. @@ -2864,7 +3672,7 @@
  3989.          IFS="$save_ifs"
  3990.        fi
  3991.  
  3992. -          if test -n "$old_library"; then
  3993. +      if test -n "$old_library"; then
  3994.          # Do each command in the old_postuninstall commands.
  3995.          eval cmds=\"$old_postuninstall_cmds\"
  3996.          IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3997. @@ -2876,21 +3684,21 @@
  3998.          IFS="$save_ifs"
  3999.        fi
  4000.  
  4001. -          # FIXME: should reinstall the best remaining shared library.
  4002. -        fi
  4003. -        ;;
  4004. +      # FIXME: should reinstall the best remaining shared library.
  4005. +    fi
  4006. +    ;;
  4007.  
  4008.        *.lo)
  4009. -        if test "$build_old_libs" = yes; then
  4010. -          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4011. -          rmfiles="$rmfiles $dir/$oldobj"
  4012. -        fi
  4013. +    if test "$build_old_libs" = yes; then
  4014. +      oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4015. +      rmfiles="$rmfiles $dir/$oldobj"
  4016. +    fi
  4017.      $show "$rm $rmfiles"
  4018.      $run $rm $rmfiles
  4019. -        ;;
  4020. +    ;;
  4021.  
  4022.        *)
  4023. -          $show "$rm $rmfiles"
  4024. +    $show "$rm $rmfiles"
  4025.      $run $rm $rmfiles
  4026.      ;;
  4027.        esac
  4028. @@ -2950,6 +3758,7 @@
  4029.  
  4030.  This mode accepts the following additional options:
  4031.  
  4032. +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  4033.    -static           always build a \`.o' file suitable for static linking
  4034.  
  4035.  COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4036. @@ -3018,18 +3827,25 @@
  4037.  The following components of LINK-COMMAND are treated specially:
  4038.  
  4039.    -all-static       do not do any dynamic linking at all
  4040. +  -avoid-version    do not add a version suffix if possible
  4041.    -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4042. -  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
  4043. +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  4044.    -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4045. +  -export-symbols SYMFILE
  4046. +            try to export only the symbols listed in SYMFILE
  4047. +  -export-symbols-regex REGEX
  4048. +            try to export only the symbols matching REGEX
  4049.    -LLIBDIR          search LIBDIR for required installed libraries
  4050.    -lNAME            OUTPUT-FILE requires the installed library libNAME
  4051. +  -module           build a library that can dlopened
  4052.    -no-undefined     declare that a library does not refer to external symbols
  4053.    -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  4054.    -release RELEASE  specify package release information
  4055.    -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  4056. +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  4057.    -static           do not do any dynamic linking of libtool libraries
  4058.    -version-info CURRENT[:REVISION[:AGE]]
  4059. -                    specify library version info [each variable defaults to 0]
  4060. +            specify library version info [each variable defaults to 0]
  4061.  
  4062.  All other options (arguments beginning with \`-') are ignored.
  4063.  
  4064. @@ -3037,8 +3853,9 @@
  4065.  treated as uninstalled libtool libraries, other files are standard or library
  4066.  object files.
  4067.  
  4068. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
  4069. -library objects (\`.lo' files) may be specified, and \`-rpath' is required.
  4070. +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4071. +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4072. +required, except when creating a convenience library.
  4073.  
  4074.  If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4075.  using \`ar' and \`ranlib', or on Windows using \`lib'.
  4076. @@ -3048,7 +3865,7 @@
  4077.    ;;
  4078.  
  4079.  uninstall)
  4080. -  $echo
  4081. +  $echo \
  4082.  "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4083.  
  4084.  Remove libraries from an installation directory.
  4085. --- ./ltconfig    Tue May 25 10:29:26 1999
  4086. +++ ../libghttp-1.0.4/./ltconfig    Sat Jul  3 23:08:29 1999
  4087. @@ -1,8 +1,8 @@
  4088.  #! /bin/sh
  4089.  
  4090.  # ltconfig - Create a system-specific libtool.
  4091. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  4092. -# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4093. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4094. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4095.  #
  4096.  # This file is free software; you can redistribute it and/or modify it
  4097.  # under the terms of the GNU General Public License as published by
  4098. @@ -32,12 +32,8 @@
  4099.    # Discard the --no-reexec flag, and continue.
  4100.    shift
  4101.  elif test "X$1" = X--fallback-echo; then
  4102. -  # used as fallback echo
  4103. -  shift
  4104. -  cat <<EOF
  4105. -$*
  4106. -EOF
  4107. -  exit 0
  4108. +  # Avoid inline document here, it may be left over
  4109. +  :
  4110.  elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  4111.    # Yippee, $echo works!
  4112.    :
  4113. @@ -46,6 +42,25 @@
  4114.    exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  4115.  fi
  4116.  
  4117. +if test "X$1" = X--fallback-echo; then
  4118. +  # used as fallback echo
  4119. +  shift
  4120. +  cat <<EOF
  4121. +$*
  4122. +EOF
  4123. +  exit 0
  4124. +fi
  4125. +
  4126. +# Find the correct PATH separator.  Usually this is `:', but
  4127. +# DJGPP uses `;' like DOS.
  4128. +if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  4129. +  UNAME=${UNAME-`uname 2>/dev/null`}
  4130. +  case X$UNAME in
  4131. +    *-DOS) PATH_SEPARATOR=';' ;;
  4132. +    *)     PATH_SEPARATOR=':' ;;
  4133. +  esac
  4134. +fi
  4135. +
  4136.  # The HP-UX ksh and POSIX shell print the target directory to stdout
  4137.  # if CDPATH is set.
  4138.  if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  4139. @@ -70,9 +85,9 @@
  4140.    #
  4141.    # So, first we look for a working echo in the user's PATH.
  4142.  
  4143. -  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4144. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4145.    for dir in $PATH /usr/ucb; do
  4146. -    if test -f $dir/echo &&
  4147. +    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  4148.         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  4149.         test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4150.        echo="$dir/echo"
  4151. @@ -87,7 +102,8 @@
  4152.         test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4153.        # This shell has a builtin print -r that does the trick.
  4154.        echo='print -r'
  4155. -    elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
  4156. +    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  4157. +     test "X$CONFIG_SHELL" != X/bin/ksh; then
  4158.        # If we have ksh, try running ltconfig again with it.
  4159.        ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  4160.        export ORIGINAL_CONFIG_SHELL
  4161. @@ -96,10 +112,10 @@
  4162.        exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  4163.      else
  4164.        # Try using printf.
  4165. -      echo='printf %s\n'
  4166. +      echo='printf "%s\n"'
  4167.        if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  4168. -         test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4169. -        # Cool, printf works
  4170. +     test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4171. +    # Cool, printf works
  4172.      :
  4173.        elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4174.         test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4175. @@ -110,9 +126,9 @@
  4176.      echo="$CONFIG_SHELL $0 --fallback-echo"
  4177.        elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4178.         test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4179. -        echo="$CONFIG_SHELL $0 --fallback-echo"
  4180. +    echo="$CONFIG_SHELL $0 --fallback-echo"
  4181.        else
  4182. -        # maybe with a smaller string...
  4183. +    # maybe with a smaller string...
  4184.      prev=:
  4185.  
  4186.      for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  4187. @@ -143,6 +159,10 @@
  4188.  # Same as above, but do not quote variable references.
  4189.  double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  4190.  
  4191. +# Sed substitution to delay expansion of an escaped shell variable in a
  4192. +# double_quote_subst'ed string.
  4193. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  4194. +
  4195.  # The name of this program.
  4196.  progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  4197.  
  4198. @@ -149,7 +169,8 @@
  4199.  # Constants:
  4200.  PROGRAM=ltconfig
  4201.  PACKAGE=libtool
  4202. -VERSION=1.2d
  4203. +VERSION=1.3.2
  4204. +TIMESTAMP=" (1.385.2.150 1999/05/26 00:28:32)"
  4205.  ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  4206.  ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  4207.  rm="rm -f"
  4208. @@ -162,6 +183,9 @@
  4209.  enable_shared=yes
  4210.  # All known linkers require a `.a' archive for static linking.
  4211.  enable_static=yes
  4212. +enable_fast_install=yes
  4213. +enable_dlopen=unknown
  4214. +enable_win32_dll=no
  4215.  ltmain=
  4216.  silent=
  4217.  srcdir=
  4218. @@ -174,18 +198,23 @@
  4219.  with_gcc=no
  4220.  with_gnu_ld=no
  4221.  need_locks=yes
  4222. +ac_ext=c
  4223.  objext=o
  4224.  libext=a
  4225. +cache_file=
  4226.  
  4227.  old_AR="$AR"
  4228.  old_CC="$CC"
  4229.  old_CFLAGS="$CFLAGS"
  4230.  old_CPPFLAGS="$CPPFLAGS"
  4231. +old_LDFLAGS="$LDFLAGS"
  4232.  old_LD="$LD"
  4233.  old_LN_S="$LN_S"
  4234. +old_LIBS="$LIBS"
  4235.  old_NM="$NM"
  4236.  old_RANLIB="$RANLIB"
  4237.  old_DLLTOOL="$DLLTOOL"
  4238. +old_OBJDUMP="$OBJDUMP"
  4239.  old_AS="$AS"
  4240.  
  4241.  # Parse the command line options.
  4242. @@ -214,6 +243,9 @@
  4243.      --debug                enable verbose shell tracing
  4244.      --disable-shared       do not build shared libraries
  4245.      --disable-static       do not build static libraries
  4246. +    --disable-fast-install do not optimize for fast installation
  4247. +    --enable-dlopen        enable dlopen support
  4248. +    --enable-win32-dll     enable building dlls on win32 hosts
  4249.      --help                 display this help and exit
  4250.      --no-verify            do not verify that HOST is a valid host type
  4251.  -o, --output=FILE          specify the output file [default=$default_ofile]
  4252. @@ -224,6 +256,7 @@
  4253.      --with-gcc             assume that the GNU C compiler will be used
  4254.      --with-gnu-ld          assume that the C compiler uses the GNU linker
  4255.      --disable-lock         disable file locking
  4256. +    --cache-file=FILE      configure cache file
  4257.  
  4258.  LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  4259.  that provides basic libtool functionality.
  4260. @@ -242,6 +275,12 @@
  4261.  
  4262.    --disable-static) enable_static=no ;;
  4263.  
  4264. +  --disable-fast-install) enable_fast_install=no ;;
  4265. +
  4266. +  --enable-dlopen) enable_dlopen=yes ;;
  4267. +
  4268. +  --enable-win32-dll) enable_win32_dll=yes ;;
  4269. +
  4270.    --quiet | --silent) silent=yes ;;
  4271.  
  4272.    --srcdir) prev=srcdir ;;
  4273. @@ -252,7 +291,7 @@
  4274.    --output | -o) prev=ofile ;;
  4275.    --output=*) ofile="$optarg" ;;
  4276.  
  4277. -  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  4278. +  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  4279.  
  4280.    --with-gcc) with_gcc=yes ;;
  4281.    --with-gnu-ld) with_gnu_ld=yes ;;
  4282. @@ -259,6 +298,8 @@
  4283.  
  4284.    --disable-lock) need_locks=no ;;
  4285.  
  4286. +  --cache-file=*) cache_file="$optarg" ;;
  4287. +
  4288.    -*)
  4289.      echo "$progname: unrecognized option \`$option'" 1>&2
  4290.      echo "$help" 1>&2
  4291. @@ -329,6 +370,11 @@
  4292.  if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  4293.  if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  4294.  
  4295. +if test -n "$cache_file" && test -r "$cache_file"; then
  4296. +  echo "loading cache $cache_file within ltconfig"
  4297. +  . $cache_file
  4298. +fi
  4299. +
  4300.  if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  4301.    # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  4302.    if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  4303. @@ -343,7 +389,7 @@
  4304.  
  4305.  if test -z "$srcdir"; then
  4306.    # Assume the source directory is the same one as the path to LTMAIN.
  4307. -  srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  4308. +  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  4309.    test "$srcdir" = "$ltmain" && srcdir=.
  4310.  fi
  4311.  
  4312. @@ -429,15 +475,18 @@
  4313.  # Set a sane default for `AR'.
  4314.  test -z "$AR" && AR=ar
  4315.  
  4316. +# Set a sane default for `OBJDUMP'.
  4317. +test -z "$OBJDUMP" && OBJDUMP=objdump
  4318. +
  4319.  # If RANLIB is not set, then run the test.
  4320.  if test "${RANLIB+set}" != "set"; then
  4321.    result=no
  4322.  
  4323.    echo $ac_n "checking for ranlib... $ac_c" 1>&6
  4324. -  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4325. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4326.    for dir in $PATH; do
  4327.      test -z "$dir" && dir=.
  4328. -    if test -f $dir/ranlib; then
  4329. +    if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
  4330.        RANLIB="ranlib"
  4331.        result="ranlib"
  4332.        break
  4333. @@ -453,8 +502,9 @@
  4334.    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  4335.  fi
  4336.  
  4337. -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
  4338. +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
  4339.  test -z "$DLLTOOL" && DLLTOOL=dlltool
  4340. +test -z "$OBJDUMP" && OBJDUMP=objdump
  4341.  test -z "$AS" && AS=as
  4342.  
  4343.  # Check to see if we are using GCC.
  4344. @@ -462,11 +512,10 @@
  4345.    # If CC is not set, then try to find GCC or a usable CC.
  4346.    if test -z "$CC"; then
  4347.      echo $ac_n "checking for gcc... $ac_c" 1>&6
  4348. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4349. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4350.      for dir in $PATH; do
  4351. -      IFS="$save_ifs"
  4352.        test -z "$dir" && dir=.
  4353. -      if test -f $dir/gcc; then
  4354. +      if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
  4355.      CC="gcc"
  4356.      break
  4357.        fi
  4358. @@ -483,11 +532,11 @@
  4359.    # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  4360.    if test -z "$CC"; then
  4361.      echo $ac_n "checking for cc... $ac_c" 1>&6
  4362. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4363. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4364.      cc_rejected=no
  4365.      for dir in $PATH; do
  4366.        test -z "$dir" && dir=.
  4367. -      if test -f $dir/cc; then
  4368. +      if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
  4369.      if test "$dir/cc" = "/usr/ucb/cc"; then
  4370.        cc_rejected=yes
  4371.        continue
  4372. @@ -527,7 +576,7 @@
  4373.    # Now see if the compiler is really GCC.
  4374.    with_gcc=no
  4375.    echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  4376. -  echo "$progname:530: checking whether we are using GNU C" >&5
  4377. +  echo "$progname:579: checking whether we are using GNU C" >&5
  4378.  
  4379.    $rm conftest.c
  4380.    cat > conftest.c <<EOF
  4381. @@ -535,7 +584,7 @@
  4382.    yes;
  4383.  #endif
  4384.  EOF
  4385. -  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  4386. +  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  4387.      with_gcc=yes
  4388.    fi
  4389.    $rm conftest.c
  4390. @@ -549,8 +598,8 @@
  4391.  echo $ac_n "checking for object suffix... $ac_c" 1>&6
  4392.  $rm conftest*
  4393.  echo 'int i = 1;' > conftest.c
  4394. -echo "$progname:552: checking for object suffix" >& 5
  4395. -if { (eval echo $progname:553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  4396. +echo "$progname:601: checking for object suffix" >& 5
  4397. +if { (eval echo $progname:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  4398.    # Append any warnings to the config.log.
  4399.    cat conftest.err 1>&5
  4400.  
  4401. @@ -580,10 +629,19 @@
  4402.    link_static_flag='-static'
  4403.  
  4404.    case "$host_os" in
  4405. -  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
  4406. +  beos* | irix5* | irix6* | osf3* | osf4*)
  4407.      # PIC is the default for these OSes.
  4408.      ;;
  4409. -  cygwin32* | mingw32* | os2*)
  4410. +  aix*)
  4411. +    # Below there is a dirty hack to force normal static linking with -ldl
  4412. +    # The problem is because libdl dynamically linked with both libc and
  4413. +    # libC (AIX C++ library), which obviously doesn't included in libraries
  4414. +    # list by gcc. This cause undefined symbols with -static flags.
  4415. +    # This hack allows C programs to be linked with "-static -ldl", but
  4416. +    # we not sure about C++ programs.
  4417. +    link_static_flag="$link_static_flag ${wl}-lC"
  4418. +    ;;
  4419. +  cygwin* | mingw* | os2*)
  4420.      # We can build DLLs from non-PIC.
  4421.      ;;
  4422.    amigaos*)
  4423. @@ -592,6 +650,11 @@
  4424.      # like `-m68040'.
  4425.      pic_flag='-m68020 -resident32 -malways-restore-a4'
  4426.      ;;
  4427. +  sysv4*MP*)
  4428. +    if test -d /usr/nec; then
  4429. +       pic_flag=-Kconform_pic
  4430. +    fi
  4431. +    ;;
  4432.    *)
  4433.      pic_flag='-fPIC'
  4434.      ;;
  4435. @@ -617,7 +680,7 @@
  4436.      # PIC (with -KPIC) is the default.
  4437.      ;;
  4438.  
  4439. -  cygwin32* | mingw32* | os2*)
  4440. +  cygwin* | mingw* | os2*)
  4441.      # We can build DLLs from non-PIC.
  4442.      ;;
  4443.  
  4444. @@ -645,7 +708,7 @@
  4445.      wl='-Qoption ld '
  4446.      ;;
  4447.  
  4448. -  sysv4.2uw2* | sysv5*)
  4449. +  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  4450.      pic_flag='-KPIC'
  4451.      link_static_flag='-Bstatic'
  4452.      wl='-Wl,'
  4453. @@ -655,7 +718,12 @@
  4454.      pic_flag='-pic'
  4455.      link_static_flag='-Bstatic'
  4456.      ;;
  4457. -
  4458. +  sysv4*MP*)
  4459. +    if test -d /usr/nec ;then
  4460. +      pic_flag='-Kconform_pic'
  4461. +      link_static_flag='-Bstatic'
  4462. +    fi
  4463. +    ;;
  4464.    *)
  4465.      can_build_shared=no
  4466.      ;;
  4467. @@ -671,22 +739,30 @@
  4468.    echo "int some_variable = 0;" > conftest.c
  4469.    save_CFLAGS="$CFLAGS"
  4470.    CFLAGS="$CFLAGS $pic_flag -DPIC"
  4471. -  echo "$progname:674: checking if $compiler PIC flag $pic_flag works" >&5
  4472. -  if { (eval echo $progname:675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  4473. +  echo "$progname:742: checking if $compiler PIC flag $pic_flag works" >&5
  4474. +  if { (eval echo $progname:743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  4475.      # Append any warnings to the config.log.
  4476.      cat conftest.err 1>&5
  4477. -
  4478. -    # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  4479. -    # create non-PIC objects.  So, if there were any warnings, we assume that
  4480. -    # PIC is not supported.
  4481. -    if test -s conftest.err; then
  4482. -      echo "$ac_t"no 1>&6
  4483. -      can_build_shared=no
  4484. -      pic_flag=
  4485. -    else
  4486. +    
  4487. +    case "$host_os" in
  4488. +    hpux9* | hpux10* | hpux11*)
  4489. +      # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  4490. +      # create non-PIC objects.  So, if there were any warnings, we assume that
  4491. +      # PIC is not supported.
  4492. +      if test -s conftest.err; then
  4493. +    echo "$ac_t"no 1>&6
  4494. +    can_build_shared=no
  4495. +    pic_flag=
  4496. +      else
  4497. +    echo "$ac_t"yes 1>&6
  4498. +    pic_flag=" $pic_flag"
  4499. +      fi
  4500. +      ;;
  4501. +    *)
  4502.        echo "$ac_t"yes 1>&6
  4503.        pic_flag=" $pic_flag"
  4504. -    fi
  4505. +      ;;
  4506. +    esac
  4507.    else
  4508.      # Append any errors to the config.log.
  4509.      cat conftest.err 1>&5
  4510. @@ -702,16 +778,26 @@
  4511.  
  4512.  # Check to see if options -o and -c are simultaneously supported by compiler
  4513.  echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  4514. +$rm -r conftest 2>/dev/null
  4515. +mkdir conftest
  4516. +cd conftest
  4517.  $rm conftest*
  4518.  echo "int some_variable = 0;" > conftest.c
  4519. +mkdir out
  4520. +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  4521. +# that will create temporary files in the current directory regardless of
  4522. +# the output directory.  Thus, making CWD read-only will cause this test
  4523. +# to fail, enabling locking or at least warning the user not to do parallel
  4524. +# builds.
  4525. +chmod -w .
  4526.  save_CFLAGS="$CFLAGS"
  4527. -CFLAGS="$CFLAGS -c -o conftest2.o"
  4528. -echo "$progname:709: checking if $compiler supports -c -o file.o" >&5
  4529. -if { (eval echo $progname:710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  4530. +CFLAGS="$CFLAGS -o out/conftest2.o"
  4531. +echo "$progname:795: checking if $compiler supports -c -o file.o" >&5
  4532. +if { (eval echo $progname:796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
  4533.  
  4534.    # The compiler can only warn and ignore the option if not recognized
  4535.    # So say no if there are warnings
  4536. -    if test -s conftest.err; then
  4537. +    if test -s out/conftest.err; then
  4538.        echo "$ac_t"no 1>&6
  4539.        compiler_c_o=no
  4540.      else
  4541. @@ -720,12 +806,17 @@
  4542.      fi
  4543.  else
  4544.    # Append any errors to the config.log.
  4545. -  cat conftest.err 1>&5
  4546. +  cat out/conftest.err 1>&5
  4547.    compiler_c_o=no
  4548.    echo "$ac_t"no 1>&6
  4549.  fi
  4550.  CFLAGS="$save_CFLAGS"
  4551. -$rm conftest*
  4552. +chmod u+w .
  4553. +$rm conftest* out/*
  4554. +rmdir out
  4555. +cd ..
  4556. +rmdir conftest
  4557. +$rm -r conftest 2>/dev/null
  4558.  
  4559.  if test x"$compiler_c_o" = x"yes"; then
  4560.    # Check to see if we can write to a .lo
  4561. @@ -734,8 +825,8 @@
  4562.    echo "int some_variable = 0;" > conftest.c
  4563.    save_CFLAGS="$CFLAGS"
  4564.    CFLAGS="$CFLAGS -c -o conftest.lo"
  4565. -  echo "$progname:737: checking if $compiler supports -c -o file.lo" >&5
  4566. -if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  4567. +  echo "$progname:828: checking if $compiler supports -c -o file.lo" >&5
  4568. +if { (eval echo $progname:829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  4569.  
  4570.      # The compiler can only warn and ignore the option if not recognized
  4571.      # So say no if there are warnings
  4572. @@ -743,8 +834,8 @@
  4573.      echo "$ac_t"no 1>&6
  4574.      compiler_o_lo=no
  4575.        else
  4576. -        echo "$ac_t"yes 1>&6
  4577. -        compiler_o_lo=yes
  4578. +    echo "$ac_t"yes 1>&6
  4579. +    compiler_o_lo=yes
  4580.        fi
  4581.    else
  4582.      # Append any errors to the config.log.
  4583. @@ -786,17 +877,17 @@
  4584.    echo "int some_variable = 0;" > conftest.c
  4585.    save_CFLAGS="$CFLAGS"
  4586.    CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  4587. -  echo "$progname:789: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  4588. -  if { (eval echo $progname:790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  4589. +  echo "$progname:880: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  4590. +  if { (eval echo $progname:881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  4591.  
  4592.      # The compiler can only warn and ignore the option if not recognized
  4593.      # So say no if there are warnings
  4594.        if test -s conftest.err; then
  4595. -        echo "$ac_t"no 1>&6
  4596. -        compiler_rtti_exceptions=no
  4597. +    echo "$ac_t"no 1>&6
  4598. +    compiler_rtti_exceptions=no
  4599.        else
  4600. -        echo "$ac_t"yes 1>&6
  4601. -        compiler_rtti_exceptions=yes
  4602. +    echo "$ac_t"yes 1>&6
  4603. +    compiler_rtti_exceptions=yes
  4604.        fi
  4605.    else
  4606.      # Append any errors to the config.log.
  4607. @@ -830,8 +921,8 @@
  4608.  echo 'main(){return(0);}' > conftest.c
  4609.  save_LDFLAGS="$LDFLAGS"
  4610.  LDFLAGS="$LDFLAGS $link_static_flag"
  4611. -echo "$progname:833: checking if $compiler static flag $link_static_flag works" >&5
  4612. -if { (eval echo $progname:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  4613. +echo "$progname:924: checking if $compiler static flag $link_static_flag works" >&5
  4614. +if { (eval echo $progname:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  4615.    echo "$ac_t$link_static_flag" 1>&6
  4616.  else
  4617.    echo "$ac_t"none 1>&6
  4618. @@ -843,9 +934,9 @@
  4619.  if test -z "$LN_S"; then
  4620.    # Check to see if we can use ln -s, or we need hard links.
  4621.    echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  4622. -  $rm conftestdata
  4623. -  if ln -s X conftestdata 2>/dev/null; then
  4624. -    $rm conftestdata
  4625. +  $rm conftest.dat
  4626. +  if ln -s X conftest.dat 2>/dev/null; then
  4627. +    $rm conftest.dat
  4628.      LN_S="ln -s"
  4629.    else
  4630.      LN_S=ln
  4631. @@ -863,48 +954,18 @@
  4632.    if test "$with_gcc" = yes; then
  4633.      # Check if gcc -print-prog-name=ld gives a path.
  4634.      echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  4635. -    echo "$progname:866: checking for ld used by GCC" >&5
  4636. +    echo "$progname:957: checking for ld used by GCC" >&5
  4637.      ac_prog=`($CC -print-prog-name=ld) 2>&5`
  4638.      case "$ac_prog" in
  4639.      # Accept absolute paths.
  4640. -    /* | [A-Za-z]:/*)
  4641. +    [\\/]* | [A-Za-z]:[\\/]*)
  4642.        re_direlt='/[^/][^/]*/\.\./'
  4643. -      sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
  4644. -      # Canonicalize the path of ld
  4645. -      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  4646. -        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  4647. -      done
  4648. -      case "$host_os" in
  4649. -      cygwin*)
  4650. -        # Convert to a UNC path for cygwin
  4651. -        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
  4652. -    ;;
  4653. -      *)
  4654. -        test -z "$LD" && LD="$ac_prog"
  4655. -    ;;
  4656. -      esac
  4657. -      ;;
  4658. -    ##
  4659. -    ## FIXME:  The code fails later on if we try to use an $LD with
  4660. -    ##         '\\' path separators.
  4661. -    ##
  4662. -    [A-Za-z]:[\\]*)
  4663. -      re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
  4664. -      sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
  4665. -      sub_uncdir='s%\\%/%g'
  4666.        # Canonicalize the path of ld
  4667. +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  4668.        while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  4669. -        ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
  4670. +    ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  4671.        done
  4672. -      case "$host_os" in
  4673. -      cygwin*)
  4674. -        # Convert to a UNC path for cygwin
  4675. -        test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
  4676. -    ;;
  4677. -      *)
  4678. -        test -z "$LD" && LD="$ac_prog"
  4679. -    ;;
  4680. -      esac
  4681. +      test -z "$LD" && LD="$ac_prog"
  4682.        ;;
  4683.      "")
  4684.        # If it fails, then pretend we are not using GCC.
  4685. @@ -917,17 +978,17 @@
  4686.      esac
  4687.    elif test "$with_gnu_ld" = yes; then
  4688.      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  4689. -    echo "$progname:920: checking for GNU ld" >&5
  4690. +    echo "$progname:981: checking for GNU ld" >&5
  4691.    else
  4692.      echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  4693. -    echo "$progname:923: checking for non-GNU ld" >&5
  4694. +    echo "$progname:984: checking for non-GNU ld" >&5
  4695.    fi
  4696.  
  4697.    if test -z "$LD"; then
  4698. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  4699. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4700.      for ac_dir in $PATH; do
  4701.        test -z "$ac_dir" && ac_dir=.
  4702. -      if test -f "$ac_dir/$ac_prog"; then
  4703. +      if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  4704.      LD="$ac_dir/$ac_prog"
  4705.      # Check to see if the program is GNU ld.  I'd rather use --version,
  4706.      # but apparently some GNU ld's only accept -v.
  4707. @@ -969,11 +1030,16 @@
  4708.  
  4709.  allow_undefined_flag=
  4710.  no_undefined_flag=
  4711. +need_lib_prefix=unknown
  4712. +need_version=unknown
  4713. +# when you set need_version to no, make sure it does not cause -set_version
  4714. +# flags to be left without arguments
  4715.  archive_cmds=
  4716. -archive_sym_cmds=
  4717. +archive_expsym_cmds=
  4718.  old_archive_from_new_cmds=
  4719.  export_dynamic_flag_spec=
  4720.  whole_archive_flag_spec=
  4721. +thread_safe_flag_spec=
  4722.  hardcode_libdir_flag_spec=
  4723.  hardcode_libdir_separator=
  4724.  hardcode_direct=no
  4725. @@ -980,99 +1046,153 @@
  4726.  hardcode_minus_L=no
  4727.  hardcode_shlibpath_var=unsupported
  4728.  runpath_var=
  4729. +always_export_symbols=no
  4730. +export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4731. +# include_expsyms should be a list of space-separated symbols to be *always*
  4732. +# included in the symbol list
  4733. +include_expsyms=
  4734. +# exclude_expsyms can be an egrep regular expression of symbols to exclude
  4735. +# it will be wrapped by ` (' and `)$', so one must not match beginning or
  4736. +# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  4737. +# as well as any symbol that contains `d'.
  4738. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  4739. +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  4740. +# platforms (ab)use it in PIC code, but their linkers get confused if
  4741. +# the symbol is explicitly referenced.  Since portable code cannot
  4742. +# rely on this symbol name, it's probably fine to never include it in
  4743. +# preloaded symbol tables.
  4744.  
  4745.  case "$host_os" in
  4746. -aix3* | aix4*)
  4747. -  # On AIX, the GNU linker works like the native linker.
  4748. -  with_gnu_ld=no
  4749. +cygwin* | mingw*)
  4750. +  # FIXME: the MSVC++ port hasn't been tested in a loooong time
  4751. +  # When not using gcc, we currently assume that we are using
  4752. +  # Microsoft Visual C++.
  4753. +  if test "$with_gcc" != yes; then
  4754. +    with_gnu_ld=no
  4755. +  fi
  4756.    ;;
  4757. +
  4758.  esac
  4759.  
  4760.  ld_shlibs=yes
  4761.  if test "$with_gnu_ld" = yes; then
  4762. +  # If archive_cmds runs LD, not CC, wlarc should be empty
  4763. +  wlarc='${wl}'
  4764.  
  4765.    # See if GNU ld supports shared libraries.
  4766.    case "$host_os" in
  4767. +  aix3* | aix4*)
  4768. +    # On AIX, the GNU linker is very broken
  4769. +    ld_shlibs=no
  4770. +    cat <<EOF 1>&2
  4771. +
  4772. +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
  4773. +*** to be unable to reliably create shared libraries on AIX.
  4774. +*** Therefore, libtool is disabling shared libraries support.  If you
  4775. +*** really care for shared libraries, you may want to modify your PATH
  4776. +*** so that a non-GNU linker is found, and then restart.
  4777. +
  4778. +EOF
  4779. +    ;;
  4780. +
  4781.    amigaos*)
  4782. -    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  4783. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  4784.      hardcode_libdir_flag_spec='-L$libdir'
  4785.      hardcode_minus_L=yes
  4786. -    ;;
  4787.  
  4788. -  sunos4*)
  4789. -    archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
  4790. -    hardcode_direct=yes
  4791. -    hardcode_minus_L=yes
  4792. -    hardcode_shlibpath_var=no
  4793. +    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  4794. +    # that the semantics of dynamic libraries on AmigaOS, at least up
  4795. +    # to version 4, is to share data among multiple programs linked
  4796. +    # with the same dynamic library.  Since this doesn't match the
  4797. +    # behavior of shared libraries on other platforms, we can use
  4798. +    # them.
  4799. +    ld_shlibs=no
  4800.      ;;
  4801.  
  4802. -  cygwin32* | mingw32*)
  4803. -    if test "$with_gcc" = yes; then
  4804. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  4805. -      # no search path for DLLs.
  4806. -      hardcode_libdir_flag_spec='-L$libdir'
  4807. +  beos*)
  4808. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  4809.        allow_undefined_flag=unsupported
  4810. -      # Very, very bogus.
  4811. -      echo '
  4812. -#define WIN32_LEAN_AND_MEAN
  4813. -#include <windows.h>
  4814. -#undef WIN32_LEAN_AND_MEAN
  4815. -#include <stdio.h>
  4816. +      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  4817. +      # support --undefined.  This deserves some investigation.  FIXME
  4818. +      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  4819. +    else
  4820. +      ld_shlibs=no
  4821. +    fi
  4822. +    ;;
  4823. +
  4824. +  cygwin* | mingw*)
  4825. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  4826. +    # no search path for DLLs.
  4827. +    hardcode_libdir_flag_spec='-L$libdir'
  4828. +    allow_undefined_flag=unsupported
  4829. +    always_export_symbols=yes
  4830.  
  4831. -BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  4832. +    # Extract the symbol export list from an `--export-all' def file,
  4833. +    # then regenerate the def file from the symbol export list, so that
  4834. +    # the compiled dll only exports the symbol export list.
  4835. +    export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  4836. +      sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  4837. +      (cd $objdir && $CC -c $soname-ltdll.c)~
  4838. +      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs~
  4839. +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  4840. +
  4841. +    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  4842. +      _lt_hint=1;
  4843. +      for symbol in `cat $export_symbols`; do
  4844. +    echo "    \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  4845. +    _lt_hint=`expr 1 + \$_lt_hint`;
  4846. +      done~
  4847. +      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  4848. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  4849. +      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  4850. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  4851. +      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  4852.  
  4853. -#include <cygwin/cygwin_dll.h>
  4854. -DECLARE_CYGWIN_DLL( DllMain );
  4855. -HINSTANCE __hDllInstance_base;
  4856. +      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  4857. +    ;;
  4858.  
  4859. -BOOL APIENTRY
  4860. -DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  4861. -{
  4862. -  __hDllInstance_base = hInst;
  4863. -  return TRUE;
  4864. -}
  4865. -' > ltdll.c
  4866. -      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  4867. -      $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
  4868. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  4869. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  4870. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  4871. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  4872. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  4873. -      $rm ltdll.$objext $soname-base $soname-exp'
  4874. -      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  4875. -      cat "$export_symbols" >> $lib-def~
  4876. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  4877. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  4878. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  4879. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  4880. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  4881. -      $rm ltdll.$objext $soname-base $soname-exp'
  4882. -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
  4883. -   else
  4884. -      # When not using gcc, we currently assume that we are using
  4885. -      # Microsoft Visual C++.
  4886. -      with_gnu_ld=no
  4887. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  4888. -      # no search path for DLLs.
  4889. -      hardcode_libdir_flag_spec=' '
  4890. -      allow_undefined_flag=unsupported
  4891. -      # Tell ltmain to make .lib files, not .a files.
  4892. -      libext=lib
  4893. -      # FIXME: Setting linknames here is a bad hack.
  4894. -      archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  4895. -      # The linker will automatically build a .lib file if we build a DLL.
  4896. -      old_archive_from_new_cmds='true'
  4897. -      # FIXME: Should let the user specify the lib program.
  4898. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  4899. -      fix_srcfile_path='`cygpath -w $srcfile`'
  4900. +  netbsd*)
  4901. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  4902. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  4903. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4904. +    else
  4905. +      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
  4906. +      # can we support soname and/or expsyms with a.out? -oliva
  4907. +    fi
  4908. +    ;;
  4909. +
  4910. +  solaris*)
  4911. +    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  4912. +      ld_shlibs=no
  4913. +      cat <<EOF 1>&2
  4914. +
  4915. +*** Warning: The releases 2.8.* of the GNU linker cannot reliably
  4916. +*** create shared libraries on Solaris systems.  Therefore, libtool
  4917. +*** is disabling shared libraries support.  We urge you to upgrade GNU
  4918. +*** binutils to release 2.9.1 or newer.  Another option is to modify
  4919. +*** your PATH or compiler configuration so that the native linker is
  4920. +*** used, and then restart.
  4921. +
  4922. +EOF
  4923. +    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  4924. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  4925. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4926. +    else
  4927. +      ld_shlibs=no
  4928.      fi
  4929. +    ;;      
  4930. +
  4931. +  sunos4*)
  4932. +    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
  4933. +    wlarc=
  4934. +    hardcode_direct=yes
  4935. +    hardcode_shlibpath_var=no
  4936.      ;;
  4937.  
  4938.    *)
  4939.      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  4940. -      archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
  4941. -      archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs'
  4942. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  4943. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4944.      else
  4945.        ld_shlibs=no
  4946.      fi
  4947. @@ -1079,11 +1199,19 @@
  4948.      ;;
  4949.    esac
  4950.  
  4951. -  if test "$ld_shlibs" = yes && test "$with_gnu_ld" = yes; then
  4952. +  if test "$ld_shlibs" = yes; then
  4953.      runpath_var=LD_RUN_PATH
  4954.      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  4955.      export_dynamic_flag_spec='${wl}--export-dynamic'
  4956. -    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  4957. +    case $host_os in
  4958. +    cygwin* | mingw*)
  4959. +      # dlltool doesn't understand --whole-archive et. al.
  4960. +      whole_archive_flag_spec=
  4961. +      ;;
  4962. +    *)
  4963. +      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  4964. +      ;;
  4965. +    esac
  4966.    fi
  4967.  else
  4968.    # PORTME fill in a description of your system's linker (not GNU ld)
  4969. @@ -1090,9 +1218,8 @@
  4970.    case "$host_os" in
  4971.    aix3*)
  4972.      allow_undefined_flag=unsupported
  4973. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
  4974. -        $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  4975. -    archive_sym_cmds='$LD -o $objdir/$soname$libobjs$deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  4976. +    always_export_symbols=yes
  4977. +    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  4978.      # Note: this linker hardcodes the directories in LIBPATH if there
  4979.      # are no directories specified by -L.
  4980.      hardcode_minus_L=yes
  4981. @@ -1104,80 +1231,67 @@
  4982.      ;;
  4983.  
  4984.    aix4*)
  4985. -    allow_undefined_flag=unsupported
  4986. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp        else cat $export_symbols > $lib.exp~
  4987. -        $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
  4988. -    archive_sym_cmds='$CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
  4989. -    hardcode_direct=yes
  4990. -    hardcode_minus_L=yes
  4991. -    ;;
  4992. +    hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
  4993. +    hardcode_libdir_separator=':'
  4994. +    if test "$with_gcc" = yes; then
  4995. +      collect2name=`${CC} -print-prog-name=collect2`
  4996. +      if test -f "$collect2name" && \
  4997. +     strings "$collect2name" | grep resolve_lib_name >/dev/null
  4998. +      then
  4999. +    # We have reworked collect2
  5000. +    hardcode_direct=yes
  5001. +      else
  5002. +    # We have old collect2
  5003. +    hardcode_direct=unsupported
  5004. +    # It fails to find uninstalled libraries when the uninstalled
  5005. +    # path is not listed in the libpath.  Setting hardcode_minus_L
  5006. +    # to unsupported forces relinking
  5007. +    hardcode_minus_L=yes
  5008. +    hardcode_libdir_flag_spec='-L$libdir'
  5009. +    hardcode_libdir_separator=
  5010. +      fi
  5011. +      shared_flag='-shared'
  5012. +    else
  5013. +      shared_flag='${wl}-bM:SRE'
  5014. +      hardcode_direct=yes
  5015. +    fi
  5016. +    allow_undefined_flag=' ${wl}-berok'
  5017. +    archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
  5018. +    archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
  5019. +    case "$host_os" in aix4.[01]|aix4.[01].*)
  5020. +      # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
  5021. +      always_export_symbols=yes ;;
  5022. +    esac
  5023. +   ;;
  5024.  
  5025.    amigaos*)
  5026. -    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib$libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5027. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5028.      hardcode_libdir_flag_spec='-L$libdir'
  5029.      hardcode_minus_L=yes
  5030. +    # see comment about different semantics on the GNU ld section
  5031. +    ld_shlibs=no
  5032.      ;;
  5033.  
  5034. -  cygwin32* | mingw32*)
  5035. -    if test "$with_gcc" = yes; then
  5036. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5037. -      # no search path for DLLs.
  5038. -      hardcode_libdir_flag_spec='-L$libdir'
  5039. -      allow_undefined_flag=unsupported
  5040. -      # Very, very bogus.
  5041. -      echo '
  5042. -#define WIN32_LEAN_AND_MEAN
  5043. -#include <windows.h>
  5044. -#undef WIN32_LEAN_AND_MEAN
  5045. -#include <stdio.h>
  5046. -
  5047. -BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  5048. -
  5049. -#include <cygwin/cygwin_dll.h>
  5050. -DECLARE_CYGWIN_DLL( DllMain );
  5051. -HINSTANCE __hDllInstance_base;
  5052. +  cygwin* | mingw*)
  5053. +    # When not using gcc, we currently assume that we are using
  5054. +    # Microsoft Visual C++.
  5055. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  5056. +    # no search path for DLLs.
  5057. +    hardcode_libdir_flag_spec=' '
  5058. +    allow_undefined_flag=unsupported
  5059. +    # Tell ltmain to make .lib files, not .a files.
  5060. +    libext=lib
  5061. +    # FIXME: Setting linknames here is a bad hack.
  5062. +    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5063. +    # The linker will automatically build a .lib file if we build a DLL.
  5064. +    old_archive_from_new_cmds='true'
  5065. +    # FIXME: Should let the user specify the lib program.
  5066. +    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5067. +    fix_srcfile_path='`cygpath -w $srcfile`'
  5068. +    ;;
  5069.  
  5070. -BOOL APIENTRY
  5071. -DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  5072. -{
  5073. -  __hDllInstance_base = hInst;
  5074. -  return TRUE;
  5075. -}
  5076. -' > ltdll.c
  5077. -      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5078. -      $DLLTOOL --export-all --output-def $lib-def $libobjs ltdll.$objext~
  5079. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5080. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5081. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5082. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5083. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5084. -      $rm ltdll.$objext $soname-base $soname-exp'
  5085. -      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib-def~
  5086. -      cat "$export_symbols" >> $lib-def~
  5087. -      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobjs ltdll.$objext~
  5088. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5089. -      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5090. -      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib-def --base-file $soname-base --output-exp $soname-exp~
  5091. -      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext$deplibs~
  5092. -      $rm ltdll.$objext $soname-base $soname-exp'
  5093. -      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib-def --output-lib $objdir/$libname.a~$rm $lib.exp'
  5094. -    else
  5095. -      # When not using gcc, we currently assume that we are using
  5096. -      # Microsoft Visual C++.
  5097. -      # hardcode_libdir_flag_spec is actually meaningless, as there is
  5098. -      # no search path for DLLs.
  5099. -      hardcode_libdir_flag_spec=' '
  5100. -      allow_undefined_flag=unsupported
  5101. -      # Tell ltmain to make .lib files, not .a files.
  5102. -      libext=lib
  5103. -      # FIXME: Setting linknames here is a bad hack.
  5104. -      archive_cmds='$CC -o $lib$libobjs`echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5105. -      # The linker will automatically build a .lib file if we build a DLL.
  5106. -      old_archive_from_new_cmds='true'
  5107. -      # FIXME: Should let the user specify the lib program.
  5108. -      old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5109. -      fix_srcfile_path='`cygpath -w $srcfile`'
  5110. -    fi
  5111. +  freebsd1*)
  5112. +    ld_shlibs=no
  5113.      ;;
  5114.  
  5115.    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  5116. @@ -1185,65 +1299,64 @@
  5117.    # does not break anything, and helps significantly (at the cost of a little
  5118.    # extra space).
  5119.    freebsd2.2*)
  5120. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o'
  5121. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  5122.      hardcode_libdir_flag_spec='-R$libdir'
  5123.      hardcode_direct=yes
  5124. -    hardcode_minus_L=yes
  5125.      hardcode_shlibpath_var=no
  5126.      ;;
  5127.  
  5128.    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  5129.    freebsd2*)
  5130. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5131. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5132.      hardcode_direct=yes
  5133.      hardcode_minus_L=yes
  5134.      hardcode_shlibpath_var=no
  5135.      ;;
  5136.  
  5137. -  # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
  5138. -  freebsd3*)
  5139. -    archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
  5140. +  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  5141. +  freebsd*)
  5142. +    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  5143.      hardcode_libdir_flag_spec='-R$libdir'
  5144.      hardcode_direct=yes
  5145. -    hardcode_minus_L=no
  5146.      hardcode_shlibpath_var=no
  5147.      ;;
  5148.  
  5149. -  hpux9*)
  5150. -    archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
  5151. -    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5152. -    hardcode_direct=yes
  5153. -    hardcode_minus_L=yes
  5154. -    export_dynamic_flag_spec='${wl}-E'
  5155. -    ;;
  5156. -
  5157. -  hpux10* | hpux11*)
  5158. -    archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
  5159. +  hpux9* | hpux10* | hpux11*)
  5160. +    case "$host_os" in
  5161. +    hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
  5162. +    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
  5163. +    esac
  5164.      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5165. +    hardcode_libdir_separator=:
  5166.      hardcode_direct=yes
  5167. -    hardcode_minus_L=yes
  5168. +    hardcode_minus_L=yes # Not in the search PATH, but as the default
  5169. +             # location of the library.
  5170.      export_dynamic_flag_spec='${wl}-E'
  5171.      ;;
  5172.  
  5173.    irix5* | irix6*)
  5174.      if test "$with_gcc" = yes; then
  5175. -      archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
  5176. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  5177.      else
  5178. -      archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  5179. +      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  5180.      fi
  5181.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5182. +    hardcode_libdir_separator=:
  5183.      ;;
  5184.  
  5185.    netbsd*)
  5186. -    # Tested with NetBSD 1.2 ld
  5187. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5188. -    hardcode_libdir_flag_spec='-R$libdir'
  5189. +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  5190. +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
  5191. +    else
  5192. +      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
  5193. +    fi
  5194. +    hardcode_libdir_flag_spec='${wl}-R$libdir'
  5195.      hardcode_direct=yes
  5196.      hardcode_shlibpath_var=no
  5197.      ;;
  5198.  
  5199.    openbsd*)
  5200. -    archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
  5201. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5202.      hardcode_libdir_flag_spec='-R$libdir'
  5203.      hardcode_direct=yes
  5204.      hardcode_shlibpath_var=no
  5205. @@ -1253,7 +1366,7 @@
  5206.      hardcode_libdir_flag_spec='-L$libdir'
  5207.      hardcode_minus_L=yes
  5208.      allow_undefined_flag=unsupported
  5209. -    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp$libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib$libobjs$deplibs $objdir/$libname.def'
  5210. +    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  5211.      old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  5212.      ;;
  5213.  
  5214. @@ -1260,10 +1373,10 @@
  5215.    osf3* | osf4*)
  5216.      if test "$with_gcc" = yes; then
  5217.        allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  5218. -      archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring$libobjs$deplibs'
  5219. +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
  5220.      else
  5221.        allow_undefined_flag=' -expect_unresolved \*'
  5222. -      archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  5223. +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
  5224.      fi
  5225.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5226.      hardcode_libdir_separator=:
  5227. @@ -1270,8 +1383,10 @@
  5228.      ;;
  5229.  
  5230.    sco3.2v5*)
  5231. -    archive_cmds='$LD -G -o $lib$libobjs$deplibs'
  5232. -    hardcode_direct=yes
  5233. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5234. +    hardcode_shlibpath_var=no
  5235. +    runpath_var=LD_RUN_PATH
  5236. +    hardcode_runpath_var=yes
  5237.      ;;
  5238.  
  5239.    solaris*)
  5240. @@ -1278,27 +1393,20 @@
  5241.      no_undefined_flag=' -z text'
  5242.      # $CC -shared without GNU ld will not create a library from C++
  5243.      # object files and a static libstdc++, better avoid it by now
  5244. -    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs'
  5245. -    archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
  5246. -        $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp'
  5247. +    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  5248. +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  5249. +        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  5250.      hardcode_libdir_flag_spec='-R$libdir'
  5251.      hardcode_shlibpath_var=no
  5252. -
  5253. -    # Solaris 2 before 2.5 hardcodes -L paths.
  5254.      case "$host_os" in
  5255. -    solaris2.[0-4]*)
  5256. -      hardcode_minus_L=yes
  5257. -      ;;
  5258. +    solaris2.[0-5] | solaris2.[0-5].*) ;;
  5259. +    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  5260. +      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
  5261.      esac
  5262.      ;;
  5263.  
  5264.    sunos4*)
  5265. -    # Why do we need -Bstatic?  To avoid inter-library dependencies, maybe...
  5266. -    if test "$with_gcc" = yes; then
  5267. -      archive_cmds='$CC -shared ${wl}-Bstatic -o $lib$libobjs$deplibs'
  5268. -    else
  5269. -      archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
  5270. -    fi
  5271. +    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  5272.      hardcode_libdir_flag_spec='-L$libdir'
  5273.      hardcode_direct=yes
  5274.      hardcode_minus_L=yes
  5275. @@ -1305,50 +1413,72 @@
  5276.      hardcode_shlibpath_var=no
  5277.      ;;
  5278.  
  5279. +  sysv4)
  5280. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5281. +    runpath_var='LD_RUN_PATH'
  5282. +    hardcode_shlibpath_var=no
  5283. +    hardcode_direct=no #Motorola manual says yes, but my tests say they lie 
  5284. +    ;;  
  5285. +
  5286. +  sysv4.3*)
  5287. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5288. +    hardcode_shlibpath_var=no
  5289. +    export_dynamic_flag_spec='-Bexport'
  5290. +    ;;
  5291. +
  5292.    uts4*)
  5293. -    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  5294. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5295.      hardcode_libdir_flag_spec='-L$libdir'
  5296. -    hardcode_direct=no
  5297. -    hardcode_minus_L=no
  5298.      hardcode_shlibpath_var=no
  5299.      ;;
  5300.  
  5301.    dgux*)
  5302. -    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  5303. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5304.      hardcode_libdir_flag_spec='-L$libdir'
  5305. -    hardcode_direct=no
  5306. -    hardcode_minus_L=no
  5307. +    hardcode_shlibpath_var=no
  5308. +    ;;
  5309. +
  5310. +  sysv4*MP*)
  5311. +    if test -d /usr/nec ;then
  5312. +    # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
  5313. +    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
  5314.      hardcode_shlibpath_var=no
  5315. +    runpath_var=LD_RUN_PATH
  5316. +    hardcode_runpath_var=yes
  5317. +    ld_shlibs=yes
  5318. +    fi
  5319.      ;;
  5320.  
  5321.    *)
  5322.      ld_shlibs=no
  5323. -    can_build_shared=no
  5324.      ;;
  5325.    esac
  5326.  fi
  5327.  echo "$ac_t$ld_shlibs" 1>&6
  5328. +test "$ld_shlibs" = no && can_build_shared=no
  5329.  
  5330.  if test -z "$NM"; then
  5331.    echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  5332.    case "$NM" in
  5333. -  /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
  5334. +  [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
  5335.    *)
  5336. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  5337. -    for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  5338. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5339. +    for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  5340.        test -z "$ac_dir" && ac_dir=.
  5341. -      if test -f $ac_dir/nm; then
  5342. -        # Check to see if the nm accepts a BSD-compat flag.
  5343. -        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  5344. -        #   nm: unknown option "B" ignored
  5345. -        if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5346. -          NM="$ac_dir/nm -B"
  5347. -        elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5348. -          NM="$ac_dir/nm -p"
  5349. +      if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
  5350. +    # Check to see if the nm accepts a BSD-compat flag.
  5351. +    # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  5352. +    #   nm: unknown option "B" ignored
  5353. +    if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5354. +      NM="$ac_dir/nm -B"
  5355. +      break
  5356. +    elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5357. +      NM="$ac_dir/nm -p"
  5358. +      break
  5359.      else
  5360. -          NM="$ac_dir/nm"
  5361. +      NM=${NM="$ac_dir/nm"} # keep the first match, but
  5362. +      continue # so that we can try to find one that supports BSD flags
  5363.      fi
  5364. -        break
  5365.        fi
  5366.      done
  5367.      IFS="$ac_save_ifs"
  5368. @@ -1365,52 +1495,54 @@
  5369.  # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  5370.  
  5371.  # Character class describing NM global symbol codes.
  5372. -symcode='[BCDEGRSTU]'
  5373. +symcode='[BCDEGRST]'
  5374.  
  5375.  # Regexp to match symbols that can be accessed directly from C.
  5376.  sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  5377.  
  5378.  # Transform the above into a raw symbol and a C symbol.
  5379. -symxfrm='\1 \1'
  5380. +symxfrm='\1 \2\3 \3'
  5381. +
  5382. +# Transform an extracted symbol line into a proper C declaration
  5383. +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5384.  
  5385.  # Define system-specific variables.
  5386.  case "$host_os" in
  5387.  aix*)
  5388. -  symcode='[BCDTU]'
  5389. +  symcode='[BCDT]'
  5390.    ;;
  5391. -sunos* | cygwin32* | mingw32*)
  5392. -  sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
  5393. -  symxfrm='_\1 \1'
  5394. +cygwin* | mingw*)
  5395. +  symcode='[ABCDGISTW]'
  5396. +  ;;
  5397. +hpux*) # Its linker distinguishes data from code symbols
  5398. +  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5399.    ;;
  5400.  irix*)
  5401. -  # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  5402.    symcode='[BCDEGRST]'
  5403.    ;;
  5404.  solaris*)
  5405. -  symcode='[BDTU]'
  5406. +  symcode='[BDT]'
  5407. +  ;;
  5408. +sysv4)
  5409. +  symcode='[DFNSTU]'
  5410.    ;;
  5411.  esac
  5412.  
  5413.  # If we're using GNU nm, then use its standard symbol codes.
  5414.  if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  5415. -  symcode='[ABCDGISTUW]'
  5416. +  symcode='[ABCDGISTW]'
  5417.  fi
  5418.  
  5419. -case "$host_os" in
  5420. -cygwin32* | mingw32*)
  5421. -  # We do not want undefined symbols on cygwin32.  The user must
  5422. -  # arrange to define them via -l arguments.
  5423. -  symcode='[ABCDGISTW]'
  5424. -  ;;
  5425. -esac
  5426. +# Try without a prefix undercore, then with it.
  5427. +for ac_symprfx in "" "_"; do
  5428.  
  5429. -# Write the raw and C identifiers.
  5430. -global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  5431. +  # Write the raw and C identifiers.
  5432. +  global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode\)[     ][     ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  5433.  
  5434. -# Check to see that the pipe works correctly.
  5435. -pipe_works=no
  5436. -$rm conftest*
  5437. -cat > conftest.c <<EOF
  5438. +  # Check to see that the pipe works correctly.
  5439. +  pipe_works=no
  5440. +  $rm conftest*
  5441. +  cat > conftest.c <<EOF
  5442.  #ifdef __cplusplus
  5443.  extern "C" {
  5444.  #endif
  5445. @@ -1422,56 +1554,50 @@
  5446.  main(){nm_test_var='a';nm_test_func();return(0);}
  5447.  EOF
  5448.  
  5449. -echo "$progname:1425: checking if global_symbol_pipe works" >&5
  5450. -if { (eval echo $progname:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  5451. -  # Now try to grab the symbols.
  5452. -  nlist=conftest.nm
  5453. -  if { echo "$progname:1429: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5454. -
  5455. -    # Try sorting and uniquifying the output.
  5456. -    if sort "$nlist" | uniq > "$nlist"T; then
  5457. -      mv -f "$nlist"T "$nlist"
  5458. -      wcout=`wc "$nlist" 2>/dev/null`
  5459. -      count=`$echo "X$wcout" | $Xsed -e 's/^[     ]*\([0-9][0-9]*\).*$/\1/'`
  5460. -      (test "$count" -ge 0) 2>/dev/null || count=-1
  5461. -    else
  5462. -      rm -f "$nlist"T
  5463. -      count=-1
  5464. -    fi
  5465. +  echo "$progname:1557: checking if global_symbol_pipe works" >&5
  5466. +  if { (eval echo $progname:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  5467. +    # Now try to grab the symbols.
  5468. +    nlist=conftest.nm
  5469. +    if { echo "$progname:1561: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5470. +
  5471. +      # Try sorting and uniquifying the output.
  5472. +      if sort "$nlist" | uniq > "$nlist"T; then
  5473. +    mv -f "$nlist"T "$nlist"
  5474. +      else
  5475. +    rm -f "$nlist"T
  5476. +      fi
  5477.  
  5478. -    # Make sure that we snagged all the symbols we need.
  5479. -    if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5480. -      if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5481. -    cat <<EOF > conftest.c
  5482. +      # Make sure that we snagged all the symbols we need.
  5483. +      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5484. +    if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5485. +      cat <<EOF > conftest.c
  5486.  #ifdef __cplusplus
  5487.  extern "C" {
  5488.  #endif
  5489.  
  5490.  EOF
  5491. -        # Now generate the symbol file.
  5492. -        sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  5493. +      # Now generate the symbol file.
  5494. +      eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  5495.  
  5496. -    cat <<EOF >> conftest.c
  5497. +      cat <<EOF >> conftest.c
  5498.  #if defined (__STDC__) && __STDC__
  5499. -# define __ptr_t void *
  5500. +# define lt_ptr_t void *
  5501.  #else
  5502. -# define __ptr_t char *
  5503. +# define lt_ptr_t char *
  5504. +# define const
  5505.  #endif
  5506.  
  5507. -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  5508. -int dld_preloaded_symbol_count = $count;
  5509. -
  5510.  /* The mapping between symbol names and symbols. */
  5511. -struct {
  5512. -  char *name;
  5513. -  __ptr_t address;
  5514. +const struct {
  5515. +  const char *name;
  5516. +  lt_ptr_t address;
  5517.  }
  5518. -dld_preloaded_symbols[] =
  5519. +lt_preloaded_symbols[] =
  5520.  {
  5521.  EOF
  5522. -        sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5523. -        cat <<\EOF >> conftest.c
  5524. -  {0, (__ptr_t) 0}
  5525. +      sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5526. +      cat <<\EOF >> conftest.c
  5527. +  {0, (lt_ptr_t) 0}
  5528.  };
  5529.  
  5530.  #ifdef __cplusplus
  5531. @@ -1478,37 +1604,50 @@
  5532.  }
  5533.  #endif
  5534.  EOF
  5535. -        # Now try linking the two files.
  5536. -        mv conftest.$objext conftestm.$objext
  5537. -    save_LIBS="$LIBS"
  5538. -    save_CFLAGS="$CFLAGS"
  5539. -        LIBS="conftestm.$objext"
  5540. -    CFLAGS="$CFLAGS$no_builtin_flag"
  5541. -        if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5542. -          pipe_works=yes
  5543. -        else
  5544. -          echo "$progname: failed program was:" >&5
  5545. -          cat conftest.c >&5
  5546. -        fi
  5547. -        LIBS="$save_LIBS"
  5548. +      # Now try linking the two files.
  5549. +      mv conftest.$objext conftstm.$objext
  5550. +      save_LIBS="$LIBS"
  5551. +      save_CFLAGS="$CFLAGS"
  5552. +      LIBS="conftstm.$objext"
  5553. +      CFLAGS="$CFLAGS$no_builtin_flag"
  5554. +      if { (eval echo $progname:1613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5555. +        pipe_works=yes
  5556. +      else
  5557. +        echo "$progname: failed program was:" >&5
  5558. +        cat conftest.c >&5
  5559. +      fi
  5560. +      LIBS="$save_LIBS"
  5561. +    else
  5562. +      echo "cannot find nm_test_func in $nlist" >&5
  5563. +    fi
  5564.        else
  5565. -        echo "cannot find nm_test_func in $nlist" >&5
  5566. +    echo "cannot find nm_test_var in $nlist" >&5
  5567.        fi
  5568.      else
  5569. -      echo "cannot find nm_test_var in $nlist" >&5
  5570. +      echo "cannot run $global_symbol_pipe" >&5
  5571.      fi
  5572.    else
  5573. -    echo "cannot run $global_symbol_pipe" >&5
  5574. +    echo "$progname: failed program was:" >&5
  5575. +    cat conftest.c >&5
  5576. +  fi
  5577. +  $rm conftest* conftst*
  5578. +
  5579. +  # Do not use the global_symbol_pipe unless it works.
  5580. +  if test "$pipe_works" = yes; then
  5581. +    break
  5582. +  else
  5583. +    global_symbol_pipe=
  5584.    fi
  5585. +done
  5586. +if test "$pipe_works" = yes; then
  5587. +  echo "${ac_t}ok" 1>&6
  5588.  else
  5589. -  echo "$progname: failed program was:" >&5
  5590. -  cat conftest.c >&5
  5591. +  echo "${ac_t}failed" 1>&6
  5592.  fi
  5593. -$rm conftest*
  5594.  
  5595. -# Do not use the global_symbol_pipe unless it works.
  5596. -echo "$ac_t$pipe_works" 1>&6
  5597. -test "$pipe_works" = yes || global_symbol_pipe=
  5598. +if test -z "$global_symbol_pipe"; then
  5599. +  global_symbol_to_cdecl=
  5600. +fi
  5601.  
  5602.  # Check hardcoding attributes.
  5603.  echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  5604. @@ -1517,10 +1656,12 @@
  5605.     test -n "$runpath_var"; then
  5606.  
  5607.    # We can hardcode non-existant directories.
  5608. -  if test "$hardcode_direct" != no && \
  5609. -     test "$hardcode_minus_L" != no && \
  5610. -     test "$hardcode_shlibpath_var" != no; then
  5611. -
  5612. +  if test "$hardcode_direct" != no &&
  5613. +     # If the only mechanism to avoid hardcoding is shlibpath_var, we
  5614. +     # have to relink, otherwise we might link with an installed library
  5615. +     # when we should be linking with a yet-to-be-installed one
  5616. +     ## test "$hardcode_shlibpath_var" != no &&
  5617. +     test "$hardcode_minus_L" != no; then
  5618.      # Linking always hardcodes the temporary library directory.
  5619.      hardcode_action=relink
  5620.    else
  5621. @@ -1552,26 +1693,27 @@
  5622.  finish_cmds=
  5623.  finish_eval=
  5624.  shlibpath_var=
  5625. +shlibpath_overrides_runpath=unknown
  5626.  version_type=none
  5627.  dynamic_linker="$host_os ld.so"
  5628. -sys_lib_search_path="/lib /usr/lib /usr/local/lib"
  5629. -check_shared_deplibs_method='none'
  5630. +sys_lib_dlsearch_path_spec="/lib /usr/lib"
  5631. +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  5632. +file_magic_cmd=
  5633. +file_magic_test_file=
  5634. +deplibs_check_method='unknown'
  5635.  # Need to set the preceding variable on all platforms that support
  5636.  # interlibrary dependencies.
  5637.  # 'none' -- dependencies not supported.
  5638. +# `unknown' -- same as none, but documents that we really don't know.
  5639.  # 'pass_all' -- all dependencies passed with no checks.
  5640.  # 'test_compile' -- check by making test program.
  5641. -# 'file_regex' -- check by looking for filenames that look like the shared
  5642. -# library in the library path.
  5643. -# 'file_magic [regex]' -- check by looking for files in library path which
  5644. -# responds to the "file" command with a given regex.  This is actually a
  5645. -# superset of the file_regex command.  If you have file on your system, you'll
  5646. -# want to use this instead.
  5647. -# Notes: regexes are run through expr.
  5648. -
  5649. +# 'file_magic [regex]' -- check by looking for files in library path
  5650. +# which responds to the $file_magic_cmd with a given egrep regex.
  5651. +# If you have `file' or equivalent on your system and you're not sure
  5652. +# whether `pass_all' will *always* work, you probably want this one.
  5653.  echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  5654.  case "$host_os" in
  5655. -aix3* | aix4*)
  5656. +aix3*)
  5657.    version_type=linux
  5658.    library_names_spec='${libname}${release}.so$versuffix $libname.a'
  5659.    shlibpath_var=LIBPATH
  5660. @@ -1580,6 +1722,18 @@
  5661.    soname_spec='${libname}${release}.so$major'
  5662.    ;;
  5663.  
  5664. +aix4*)
  5665. +  version_type=linux
  5666. +  # AIX has no versioning support, so currently we can not hardcode correct
  5667. +  # soname into executable. Probably we can add versioning support to
  5668. +  # collect2, so additional links can be useful in future.
  5669. +  # We preserve .a as extension for shared libraries though AIX4.2
  5670. +  # and later linker supports .so
  5671. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
  5672. +  shlibpath_var=LIBPATH
  5673. +  deplibs_check_method=pass_all
  5674. +  ;;
  5675. +
  5676.  amigaos*)
  5677.    library_names_spec='$libname.ixlibrary $libname.a'
  5678.    # Create ${libname}_ixlibrary.a entries in /sys/libs.
  5679. @@ -1586,15 +1740,33 @@
  5680.    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  5681.    ;;
  5682.  
  5683. +beos*)
  5684. +  library_names_spec='${libname}.so'
  5685. +  dynamic_linker="$host_os ld.so"
  5686. +  shlibpath_var=LIBRARY_PATH
  5687. +  deplibs_check_method=pass_all
  5688. +  lt_cv_dlopen="load_add_on"
  5689. +  lt_cv_dlopen_libs=
  5690. +  lt_cv_dlopen_self=yes
  5691. +  ;;
  5692. +
  5693.  bsdi4*)
  5694.    version_type=linux
  5695. -  library_names_spec='${libname}.so.$major ${libname}.so'
  5696. +  library_names_spec='${libname}.so$major ${libname}.so'
  5697.    soname_spec='${libname}.so'
  5698. -  finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
  5699. +  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  5700.    shlibpath_var=LD_LIBRARY_PATH
  5701. +  deplibs_check_method='file_magic ELF 32-bit LSB shared object'
  5702. +  file_magic_cmd=/usr/bin/file
  5703. +  file_magic_test_file=/shlib/libc.so
  5704. +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  5705. +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  5706. +  # the default ld.so.conf also contains /usr/contrib/lib and
  5707. +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  5708. +  # libtool to hard-code these into programs
  5709.    ;;
  5710.  
  5711. -cygwin32* | mingw32*)
  5712. +cygwin* | mingw*)
  5713.    version_type=windows
  5714.    if test "$with_gcc" = yes; then
  5715.      library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
  5716. @@ -1602,15 +1774,38 @@
  5717.      library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
  5718.    fi
  5719.    dynamic_linker='Win32 ld.exe'
  5720. -  libname_spec='$name'
  5721. +  deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  5722. +  file_magic_cmd='${OBJDUMP} -f'
  5723. +  need_lib_prefix=no
  5724. +  # FIXME: first we should search . and the directory the executable is in
  5725.    shlibpath_var=PATH
  5726. +  lt_cv_dlopen="LoadLibrary"
  5727. +  lt_cv_dlopen_libs=
  5728.    ;;
  5729.  
  5730. -freebsd2* | freebsd3*)
  5731. +freebsd1*)
  5732. +  dynamic_linker=no
  5733. +  ;;
  5734. +  
  5735. +freebsd*)
  5736.    objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  5737.    version_type=freebsd-$objformat
  5738. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  5739. -  finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
  5740. +  case "$version_type" in
  5741. +    freebsd-elf*)
  5742. +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  5743. +      file_magic_cmd=/usr/bin/file
  5744. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  5745. +      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  5746. +      need_version=no
  5747. +      need_lib_prefix=no
  5748. +      ;;
  5749. +    freebsd-*)
  5750. +      deplibs_check_method=unknown
  5751. +      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  5752. +      need_version=yes
  5753. +      ;;
  5754. +  esac
  5755. +  finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
  5756.    shlibpath_var=LD_LIBRARY_PATH
  5757.    ;;
  5758.  
  5759. @@ -1625,7 +1820,10 @@
  5760.    # link against other versions.
  5761.    dynamic_linker="$host_os dld.sl"
  5762.    version_type=sunos
  5763. +  need_lib_prefix=no
  5764. +  need_version=no
  5765.    shlibpath_var=SHLIB_PATH
  5766. +  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  5767.    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  5768.    soname_spec='${libname}${release}.sl$major'
  5769.    # HP-UX runs *really* slowly unless shared libraries are mode 555.
  5770. @@ -1632,18 +1830,36 @@
  5771.    postinstall_cmds='chmod 555 $lib'
  5772.    ;;
  5773.  
  5774. -irix5*)
  5775. -  version_type=osf
  5776. -  soname_spec='${libname}${release}.so'
  5777. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  5778. -  shlibpath_var=LD_LIBRARY_PATH
  5779. -  ;;
  5780. -
  5781. -irix6*)
  5782. -  version_type=osf
  5783. -  soname_spec='${libname}${release}.so'
  5784. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  5785. -  shlibpath_var=LD_LIBRARYN32_PATH
  5786. +irix5* | irix6*)
  5787. +  version_type=irix
  5788. +  need_lib_prefix=no
  5789. +  need_version=no
  5790. +  soname_spec='${libname}${release}.so.$major'
  5791. +  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
  5792. +  case "$host_os" in
  5793. +  irix5*)
  5794. +    libsuff= shlibsuff=
  5795. +    # this will be overridden with pass_all, but let us keep it just in case
  5796. +    deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  5797. +    ;;
  5798. +  *)
  5799. +    case "$LD" in # libtool.m4 will add one of these switches to LD
  5800. +    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  5801. +    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  5802. +    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  5803. +    *) libsuff= shlibsuff= libmagic=never-match;;
  5804. +    esac
  5805. +    # this will be overridden with pass_all, but let us keep it just in case
  5806. +    deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
  5807. +    ;;
  5808. +  esac
  5809. +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  5810. +  shlibpath_overrides_runpath=no
  5811. +  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  5812. +  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  5813. +  file_magic_cmd=/usr/bin/file
  5814. +  file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  5815. +  deplibs_check_method='pass_all'
  5816.    ;;
  5817.  
  5818.  # No shared lib support for Linux oldld, aout, or coff.
  5819. @@ -1654,12 +1870,16 @@
  5820.  # This must be Linux ELF.
  5821.  linux-gnu*)
  5822.    version_type=linux
  5823. +  need_lib_prefix=no
  5824. +  need_version=no
  5825.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5826.    soname_spec='${libname}${release}.so$major'
  5827.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  5828.    shlibpath_var=LD_LIBRARY_PATH
  5829. -  check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
  5830. -  sys_lib_search_path="/lib /usr/lib /usr/local/lib `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`"
  5831. +  shlibpath_overrides_runpath=no
  5832. +  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
  5833. +  file_magic_cmd=/usr/bin/file
  5834. +  file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  5835.  
  5836.    if test -f /lib/ld.so.1; then
  5837.      dynamic_linker='GNU ld.so'
  5838. @@ -1672,9 +1892,27 @@
  5839.    fi
  5840.    ;;
  5841.  
  5842. -netbsd* | openbsd*)
  5843. +netbsd*)
  5844. +  version_type=sunos
  5845. +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  5846. +    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5847. +    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  5848. +    dynamic_linker='NetBSD (a.out) ld.so'
  5849. +  else
  5850. +    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  5851. +    soname_spec='${libname}${release}.so$major'
  5852. +    dynamic_linker='NetBSD ld.elf_so'
  5853. +  fi
  5854. +  shlibpath_var=LD_LIBRARY_PATH
  5855. +  ;;
  5856. +
  5857. +openbsd*)
  5858.    version_type=sunos
  5859. -  library_names_spec='${libname}${release}.so$versuffix'
  5860. +  if test "$with_gnu_ld" = yes; then
  5861. +    need_lib_prefix=no
  5862. +    need_version=no
  5863. +  fi
  5864. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5865.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  5866.    shlibpath_var=LD_LIBRARY_PATH
  5867.    ;;
  5868. @@ -1681,6 +1919,7 @@
  5869.  
  5870.  os2*)
  5871.    libname_spec='$name'
  5872. +  need_lib_prefix=no
  5873.    library_names_spec='$libname.dll $libname.a'
  5874.    dynamic_linker='OS/2 ld.exe'
  5875.    shlibpath_var=LIBPATH
  5876. @@ -1688,10 +1927,17 @@
  5877.  
  5878.  osf3* | osf4*)
  5879.    version_type=osf
  5880. +  need_version=no
  5881.    soname_spec='${libname}${release}.so'
  5882. -  library_names_spec='${libname}${release}.so$versuffix $libname.so'
  5883. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  5884.    shlibpath_var=LD_LIBRARY_PATH
  5885. -  check_shared_deplibs_method='pass_all'
  5886. +  # this will be overridden with pass_all, but let us keep it just in case
  5887. +  deplibs_check_method='file_magic COFF format alpha shared library'
  5888. +  file_magic_cmd=/usr/bin/file
  5889. +  file_magic_test_file=/shlib/libc.so
  5890. +  deplibs_check_method='pass_all'
  5891. +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  5892. +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  5893.    ;;
  5894.  
  5895.  sco3.2v5*)
  5896. @@ -1703,11 +1949,17 @@
  5897.  
  5898.  solaris*)
  5899.    version_type=linux
  5900. +  need_lib_prefix=no
  5901. +  need_version=no
  5902.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5903.    soname_spec='${libname}${release}.so$major'
  5904.    shlibpath_var=LD_LIBRARY_PATH
  5905. +  shlibpath_overrides_runpath=yes
  5906.    # ldd complains unless libraries are executable
  5907.    postinstall_cmds='chmod +x $lib'
  5908. +  deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
  5909. +  file_magic_cmd=/usr/bin/file
  5910. +  file_magic_test_file=/lib/libc.so
  5911.    ;;
  5912.  
  5913.  sunos4*)
  5914. @@ -1715,29 +1967,59 @@
  5915.    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5916.    finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  5917.    shlibpath_var=LD_LIBRARY_PATH
  5918. +  shlibpath_overrides_runpath=yes
  5919. +  if test "$with_gnu_ld" = yes; then
  5920. +    need_lib_prefix=no
  5921. +  fi
  5922. +  need_version=yes
  5923.    ;;
  5924.  
  5925. -sysv4.2uw2*)
  5926. +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  5927.    version_type=linux
  5928.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5929.    soname_spec='${libname}${release}.so$major'
  5930.    shlibpath_var=LD_LIBRARY_PATH
  5931. +  case "$host_vendor" in
  5932. +    ncr)
  5933. +      deplibs_check_method='pass_all'
  5934. +      ;;
  5935. +    motorola)
  5936. +      need_lib_prefix=no
  5937. +      need_version=no
  5938. +      shlibpath_overrides_runpath=no
  5939. +      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  5940. +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
  5941. +      file_magic_cmd=/usr/bin/file
  5942. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  5943. +      ;;
  5944. +  esac
  5945.    ;;
  5946.  
  5947.  uts4*)
  5948.    version_type=linux
  5949. -  library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  5950. -  soname_spec='${libname}${release}.so.$major'
  5951. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5952. +  soname_spec='${libname}${release}.so$major'
  5953.    shlibpath_var=LD_LIBRARY_PATH
  5954.    ;;
  5955.  
  5956.  dgux*)
  5957.    version_type=linux
  5958. +  need_lib_prefix=no
  5959. +  need_version=no
  5960.    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5961.    soname_spec='${libname}${release}.so$major'
  5962.    shlibpath_var=LD_LIBRARY_PATH
  5963.    ;;
  5964.  
  5965. +sysv4*MP*)
  5966. +  if test -d /usr/nec ;then
  5967. +    version_type=linux
  5968. +    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  5969. +    soname_spec='$libname.so.$major'
  5970. +    shlibpath_var=LD_LIBRARY_PATH
  5971. +  fi
  5972. +  ;;
  5973. +
  5974.  *)
  5975.    dynamic_linker=no
  5976.    ;;
  5977. @@ -1748,6 +2030,41 @@
  5978.  # Report the final consequences.
  5979.  echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  5980.  
  5981. +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
  5982. +# configure.in, otherwise build static only libraries.
  5983. +case "$host_os" in
  5984. +cygwin* | mingw* | os2*)
  5985. +  if test x$can_build_shared = xyes; then
  5986. +    test x$enable_win32_dll = xno && can_build_shared=no
  5987. +    echo "checking if package supports dlls... $can_build_shared" 1>&6
  5988. +  fi
  5989. +;;
  5990. +esac
  5991. +
  5992. +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
  5993. +  case "$deplibs_check_method" in
  5994. +  "file_magic "*)
  5995. +    file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  5996. +    if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  5997. +       egrep "$file_magic_regex" > /dev/null; then
  5998. +      :
  5999. +    else
  6000. +      cat <<EOF 1>&2
  6001. +
  6002. +*** Warning: the command libtool uses to detect shared libraries,
  6003. +*** $file_magic_cmd, produces output that libtool cannot recognize.
  6004. +*** The result is that libtool may fail to recognize shared libraries
  6005. +*** as such.  This will affect the creation of libtool libraries that
  6006. +*** depend on shared libraries, but programs linked with such libtool
  6007. +*** libraries will work regardless of this problem.  Nevertheless, you
  6008. +*** may want to report the problem to your system manager and/or to
  6009. +*** bug-libtool@gnu.org
  6010. +
  6011. +EOF
  6012. +    fi ;;
  6013. +  esac
  6014. +fi
  6015. +
  6016.  echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  6017.  test "$can_build_shared" = "no" && enable_shared=no
  6018.  
  6019. @@ -1754,7 +2071,7 @@
  6020.  # On AIX, shared libraries and static libraries use the same namespace, and
  6021.  # are all built from PIC.
  6022.  case "$host_os" in
  6023. -aix*)
  6024. +aix3*)
  6025.    test "$enable_shared" = yes && enable_static=no
  6026.    if test -n "$RANLIB"; then
  6027.      archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6028. @@ -1761,6 +2078,10 @@
  6029.      postinstall_cmds='$RANLIB $lib'
  6030.    fi
  6031.    ;;
  6032. +
  6033. +aix4*)
  6034. +  test "$enable_shared" = yes && enable_static=no
  6035. +  ;;
  6036.  esac
  6037.  
  6038.  echo "$ac_t$enable_shared" 1>&6
  6039. @@ -1770,6 +2091,15 @@
  6040.  
  6041.  echo "checking whether to build static libraries... $enable_static" 1>&6
  6042.  
  6043. +if test "$hardcode_action" = relink; then
  6044. +  # Fast installation is not supported
  6045. +  enable_fast_install=no
  6046. +elif test "$shlibpath_overrides_runpath" = yes ||
  6047. +     test "$enable_shared" = no; then
  6048. +  # Fast installation is not necessary
  6049. +  enable_fast_install=needless
  6050. +fi
  6051. +
  6052.  echo $ac_n "checking for objdir... $ac_c" 1>&6
  6053.  rm -f .libs 2>/dev/null
  6054.  mkdir .libs 2>/dev/null
  6055. @@ -1782,6 +2112,434 @@
  6056.  rmdir .libs 2>/dev/null
  6057.  echo "$ac_t$objdir" 1>&6
  6058.  
  6059. +if test "x$enable_dlopen" != xyes; then
  6060. +  enable_dlopen=unknown
  6061. +  enable_dlopen_self=unknown
  6062. +  enable_dlopen_self_static=unknown
  6063. +else
  6064. +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
  6065. +  lt_cv_dlopen=no lt_cv_dlopen_libs=
  6066. +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  6067. +echo "$progname:2123: checking for dlopen in -ldl" >&5
  6068. +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
  6069. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6070. +  echo $ac_n "(cached) $ac_c" 1>&6
  6071. +else
  6072. +  ac_save_LIBS="$LIBS"
  6073. +LIBS="-ldl  $LIBS"
  6074. +cat > conftest.$ac_ext <<EOF
  6075. +#line 2131 "ltconfig"
  6076. +/* Override any gcc2 internal prototype to avoid an error.  */
  6077. +/* We use char because int might match the return type of a gcc2
  6078. +    builtin and then its argument prototype would still apply.  */
  6079. +char dlopen();
  6080. +
  6081. +int main() {
  6082. +dlopen()
  6083. +; return 0; }
  6084. +EOF
  6085. +if { (eval echo $progname:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6086. +  rm -rf conftest*
  6087. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6088. +else
  6089. +  echo "$progname: failed program was:" >&5
  6090. +  cat conftest.$ac_ext >&5
  6091. +  rm -rf conftest*
  6092. +  eval "ac_cv_lib_$ac_lib_var=no"
  6093. +fi
  6094. +rm -f conftest*
  6095. +LIBS="$ac_save_LIBS"
  6096. +
  6097. +fi
  6098. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6099. +  echo "$ac_t""yes" 1>&6
  6100. +  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
  6101. +else
  6102. +  echo "$ac_t""no" 1>&6
  6103. +echo $ac_n "checking for dlopen""... $ac_c" 1>&6
  6104. +echo "$progname:2160: checking for dlopen" >&5
  6105. +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  6106. +  echo $ac_n "(cached) $ac_c" 1>&6
  6107. +else
  6108. +  cat > conftest.$ac_ext <<EOF
  6109. +#line 2165 "ltconfig"
  6110. +/* System header to define __stub macros and hopefully few prototypes,
  6111. +    which can conflict with char dlopen(); below.  */
  6112. +#include <assert.h>
  6113. +/* Override any gcc2 internal prototype to avoid an error.  */
  6114. +/* We use char because int might match the return type of a gcc2
  6115. +    builtin and then its argument prototype would still apply.  */
  6116. +char dlopen();
  6117. +
  6118. +int main() {
  6119. +
  6120. +/* The GNU C library defines this for functions which it implements
  6121. +    to always fail with ENOSYS.  Some functions are actually named
  6122. +    something starting with __ and the normal name is an alias.  */
  6123. +#if defined (__stub_dlopen) || defined (__stub___dlopen)
  6124. +choke me
  6125. +#else
  6126. +dlopen();
  6127. +#endif
  6128. +
  6129. +; return 0; }
  6130. +EOF
  6131. +if { (eval echo $progname:2187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6132. +  rm -rf conftest*
  6133. +  eval "ac_cv_func_dlopen=yes"
  6134. +else
  6135. +  echo "$progname: failed program was:" >&5
  6136. +  cat conftest.$ac_ext >&5
  6137. +  rm -rf conftest*
  6138. +  eval "ac_cv_func_dlopen=no"
  6139. +fi
  6140. +rm -f conftest*
  6141. +fi
  6142. +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  6143. +  echo "$ac_t""yes" 1>&6
  6144. +  lt_cv_dlopen="dlopen"
  6145. +else
  6146. +  echo "$ac_t""no" 1>&6
  6147. +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
  6148. +echo "$progname:2204: checking for dld_link in -ldld" >&5
  6149. +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
  6150. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6151. +  echo $ac_n "(cached) $ac_c" 1>&6
  6152. +else
  6153. +  ac_save_LIBS="$LIBS"
  6154. +LIBS="-ldld  $LIBS"
  6155. +cat > conftest.$ac_ext <<EOF
  6156. +#line 2212 "ltconfig"
  6157. +/* Override any gcc2 internal prototype to avoid an error.  */
  6158. +/* We use char because int might match the return type of a gcc2
  6159. +    builtin and then its argument prototype would still apply.  */
  6160. +char dld_link();
  6161. +
  6162. +int main() {
  6163. +dld_link()
  6164. +; return 0; }
  6165. +EOF
  6166. +if { (eval echo $progname:2222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6167. +  rm -rf conftest*
  6168. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6169. +else
  6170. +  echo "$progname: failed program was:" >&5
  6171. +  cat conftest.$ac_ext >&5
  6172. +  rm -rf conftest*
  6173. +  eval "ac_cv_lib_$ac_lib_var=no"
  6174. +fi
  6175. +rm -f conftest*
  6176. +LIBS="$ac_save_LIBS"
  6177. +
  6178. +fi
  6179. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6180. +  echo "$ac_t""yes" 1>&6
  6181. +  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
  6182. +else
  6183. +  echo "$ac_t""no" 1>&6
  6184. +echo $ac_n "checking for shl_load""... $ac_c" 1>&6
  6185. +echo "$progname:2241: checking for shl_load" >&5
  6186. +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  6187. +  echo $ac_n "(cached) $ac_c" 1>&6
  6188. +else
  6189. +  cat > conftest.$ac_ext <<EOF
  6190. +#line 2246 "ltconfig"
  6191. +/* System header to define __stub macros and hopefully few prototypes,
  6192. +    which can conflict with char shl_load(); below.  */
  6193. +#include <assert.h>
  6194. +/* Override any gcc2 internal prototype to avoid an error.  */
  6195. +/* We use char because int might match the return type of a gcc2
  6196. +    builtin and then its argument prototype would still apply.  */
  6197. +char shl_load();
  6198. +
  6199. +int main() {
  6200. +
  6201. +/* The GNU C library defines this for functions which it implements
  6202. +    to always fail with ENOSYS.  Some functions are actually named
  6203. +    something starting with __ and the normal name is an alias.  */
  6204. +#if defined (__stub_shl_load) || defined (__stub___shl_load)
  6205. +choke me
  6206. +#else
  6207. +shl_load();
  6208. +#endif
  6209. +
  6210. +; return 0; }
  6211. +EOF
  6212. +if { (eval echo $progname:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6213. +  rm -rf conftest*
  6214. +  eval "ac_cv_func_shl_load=yes"
  6215. +else
  6216. +  echo "$progname: failed program was:" >&5
  6217. +  cat conftest.$ac_ext >&5
  6218. +  rm -rf conftest*
  6219. +  eval "ac_cv_func_shl_load=no"
  6220. +fi
  6221. +rm -f conftest*
  6222. +fi
  6223. +
  6224. +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  6225. +  echo "$ac_t""yes" 1>&6
  6226. +  lt_cv_dlopen="shl_load"
  6227. +else
  6228. +  echo "$ac_t""no" 1>&6
  6229. +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
  6230. +echo "$progname:2286: checking for shl_load in -ldld" >&5
  6231. +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
  6232. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6233. +  echo $ac_n "(cached) $ac_c" 1>&6
  6234. +else
  6235. +  ac_save_LIBS="$LIBS"
  6236. +LIBS="-ldld  $LIBS"
  6237. +cat > conftest.$ac_ext <<EOF
  6238. +#line 2294 "ltconfig"
  6239. +#include "confdefs.h"
  6240. +/* Override any gcc2 internal prototype to avoid an error.  */
  6241. +/* We use char because int might match the return type of a gcc2
  6242. +    builtin and then its argument prototype would still apply.  */
  6243. +char shl_load();
  6244. +
  6245. +int main() {
  6246. +shl_load()
  6247. +; return 0; }
  6248. +EOF
  6249. +if { (eval echo $progname:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6250. +  rm -rf conftest*
  6251. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6252. +else
  6253. +  echo "$progname: failed program was:" >&5
  6254. +  cat conftest.$ac_ext >&5
  6255. +  rm -rf conftest*
  6256. +  eval "ac_cv_lib_$ac_lib_var=no"
  6257. +fi
  6258. +rm -f conftest*
  6259. +LIBS="$ac_save_LIBS"
  6260. +
  6261. +fi
  6262. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6263. +  echo "$ac_t""yes" 1>&6
  6264. +  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
  6265. +else
  6266. +  echo "$ac_t""no" 1>&6
  6267. +fi
  6268. +
  6269. +
  6270. +fi
  6271. +
  6272. +    
  6273. +fi
  6274. +
  6275. +  
  6276. +fi
  6277. +
  6278. +
  6279. +fi
  6280. +
  6281. +fi
  6282. +
  6283. +  if test "x$lt_cv_dlopen" != xno; then
  6284. +    enable_dlopen=yes
  6285. +  fi
  6286. +
  6287. +  case "$lt_cv_dlopen" in
  6288. +  dlopen)
  6289. +for ac_hdr in dlfcn.h; do
  6290. +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  6291. +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  6292. +echo "$progname:2348: checking for $ac_hdr" >&5
  6293. +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6294. +  echo $ac_n "(cached) $ac_c" 1>&6
  6295. +else
  6296. +  cat > conftest.$ac_ext <<EOF
  6297. +#line 2353 "ltconfig"
  6298. +#include <$ac_hdr>
  6299. +int fnord = 0;
  6300. +EOF
  6301. +ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
  6302. +{ (eval echo $progname:2358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  6303. +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  6304. +if test -z "$ac_err"; then
  6305. +  rm -rf conftest*
  6306. +  eval "ac_cv_header_$ac_safe=yes"
  6307. +else
  6308. +  echo "$ac_err" >&5
  6309. +  echo "$progname: failed program was:" >&5
  6310. +  cat conftest.$ac_ext >&5
  6311. +  rm -rf conftest*
  6312. +  eval "ac_cv_header_$ac_safe=no"
  6313. +fi
  6314. +rm -f conftest*
  6315. +fi
  6316. +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6317. +  echo "$ac_t""yes" 1>&6
  6318. +else
  6319. +  echo "$ac_t""no" 1>&6
  6320. +fi
  6321. +done
  6322. +
  6323. +    if test "x$ac_cv_header_dlfcn_h" = xyes; then
  6324. +      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  6325. +    fi
  6326. +    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  6327. +    LIBS="$lt_cv_dlopen_libs $LIBS"
  6328. +
  6329. +  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
  6330. +echo "$progname:2386: checking whether a program can dlopen itself" >&5
  6331. +if test "${lt_cv_dlopen_self+set}" = set; then
  6332. +  echo $ac_n "(cached) $ac_c" 1>&6
  6333. +else
  6334. +  if test "$cross_compiling" = yes; then
  6335. +    lt_cv_dlopen_self=cross
  6336. +  else
  6337. +    cat > conftest.c <<EOF
  6338. +#line 2394 "ltconfig"
  6339. +
  6340. +#if HAVE_DLFCN_H
  6341. +#include <dlfcn.h>
  6342. +#endif
  6343. +
  6344. +#include <stdio.h>
  6345. +
  6346. +#ifdef RTLD_GLOBAL
  6347. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6348. +#else
  6349. +# ifdef DL_GLOBAL
  6350. +#  define LTDL_GLOBAL    DL_GLOBAL
  6351. +# else
  6352. +#  define LTDL_GLOBAL    0
  6353. +# endif
  6354. +#endif
  6355. +
  6356. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6357. +   find out it does not work in some platform. */
  6358. +#ifndef LTDL_LAZY_OR_NOW
  6359. +# ifdef RTLD_LAZY
  6360. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6361. +# else
  6362. +#  ifdef DL_LAZY
  6363. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6364. +#  else
  6365. +#   ifdef RTLD_NOW
  6366. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6367. +#   else
  6368. +#    ifdef DL_NOW
  6369. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6370. +#    else
  6371. +#     define LTDL_LAZY_OR_NOW    0
  6372. +#    endif
  6373. +#   endif
  6374. +#  endif
  6375. +# endif
  6376. +#endif
  6377. +
  6378. +fnord() { int i=42;}
  6379. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6380. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6381. +           if(ptr1 || ptr2) exit(0); } exit(1); } 
  6382. +
  6383. +EOF
  6384. +if { (eval echo $progname:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6385. +then
  6386. +  lt_cv_dlopen_self=yes
  6387. +else
  6388. +  echo "$progname: failed program was:" >&5
  6389. +  cat conftest.$ac_ext >&5
  6390. +  rm -fr conftest*
  6391. +  lt_cv_dlopen_self=no
  6392. +fi
  6393. +rm -fr conftest*
  6394. +fi
  6395. +
  6396. +fi
  6397. +
  6398. +echo "$ac_t""$lt_cv_dlopen_self" 1>&6
  6399. +
  6400. +  if test "$lt_cv_dlopen_self" = yes; then
  6401. +    LDFLAGS="$LDFLAGS $link_static_flag"
  6402. +  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
  6403. +echo "$progname:2459: checking whether a statically linked program can dlopen itself" >&5
  6404. +if test "${lt_cv_dlopen_self_static+set}" = set; then
  6405. +  echo $ac_n "(cached) $ac_c" 1>&6
  6406. +else
  6407. +  if test "$cross_compiling" = yes; then
  6408. +    lt_cv_dlopen_self_static=cross
  6409. +  else
  6410. +    cat > conftest.c <<EOF
  6411. +#line 2467 "ltconfig"
  6412. +
  6413. +#if HAVE_DLFCN_H
  6414. +#include <dlfcn.h>
  6415. +#endif
  6416. +
  6417. +#include <stdio.h>
  6418. +
  6419. +#ifdef RTLD_GLOBAL
  6420. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6421. +#else
  6422. +# ifdef DL_GLOBAL
  6423. +#  define LTDL_GLOBAL    DL_GLOBAL
  6424. +# else
  6425. +#  define LTDL_GLOBAL    0
  6426. +# endif
  6427. +#endif
  6428. +
  6429. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6430. +   find out it does not work in some platform. */
  6431. +#ifndef LTDL_LAZY_OR_NOW
  6432. +# ifdef RTLD_LAZY
  6433. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6434. +# else
  6435. +#  ifdef DL_LAZY
  6436. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6437. +#  else
  6438. +#   ifdef RTLD_NOW
  6439. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6440. +#   else
  6441. +#    ifdef DL_NOW
  6442. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6443. +#    else
  6444. +#     define LTDL_LAZY_OR_NOW    0
  6445. +#    endif
  6446. +#   endif
  6447. +#  endif
  6448. +# endif
  6449. +#endif
  6450. +
  6451. +fnord() { int i=42;}
  6452. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6453. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6454. +    if(ptr1 || ptr2) exit(0); } exit(1); } 
  6455. +
  6456. +EOF
  6457. +if { (eval echo $progname:2513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6458. +then
  6459. +  lt_cv_dlopen_self_static=yes
  6460. +else
  6461. +  echo "$progname: failed program was:" >&5
  6462. +  cat conftest.$ac_ext >&5
  6463. +  rm -fr conftest*
  6464. +  lt_cv_dlopen_self_static=no
  6465. +fi
  6466. +rm -fr conftest*
  6467. +fi
  6468. +
  6469. +fi
  6470. +
  6471. +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
  6472. +fi
  6473. +    ;;
  6474. +  esac
  6475. +
  6476. +  case "$lt_cv_dlopen_self" in
  6477. +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6478. +  *) enable_dlopen_self=unknown ;;
  6479. +  esac
  6480. +
  6481. +  case "$lt_cv_dlopen_self_static" in
  6482. +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6483. +  *) enable_dlopen_self_static=unknown ;;
  6484. +  esac
  6485. +fi
  6486. +
  6487.  # Copy echo and quote the copy, instead of the original, because it is
  6488.  # used later.
  6489.  ltecho="$echo"
  6490. @@ -1790,30 +2548,36 @@
  6491.  fi
  6492.  LTSHELL="$SHELL"
  6493.  
  6494. +LTCONFIG_VERSION="$VERSION"
  6495. +
  6496.  # Only quote variables if we're using ltmain.sh.
  6497.  case "$ltmain" in
  6498.  *.sh)
  6499.    # Now quote all the things that may contain metacharacters.
  6500. -  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  6501. -    old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \
  6502. +  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
  6503. +    old_LD old_LDFLAGS old_LIBS \
  6504. +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
  6505. +    AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
  6506.      reload_flag reload_cmds wl \
  6507.      pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
  6508. -    whole_archive_flag_spec libname_spec library_names_spec soname_spec \
  6509. +    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  6510. +    library_names_spec soname_spec \
  6511.      RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  6512. -    old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
  6513. -    check_shared_deplibs_method allow_undefined_flag no_undefined_flag \
  6514. -    finish_cmds finish_eval global_symbol_pipe \
  6515. -    hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path \
  6516. -    compiler_c_o compiler_o_lo need_locks; do
  6517. +    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
  6518. +    file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
  6519. +    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  6520. +    hardcode_libdir_flag_spec hardcode_libdir_separator  \
  6521. +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  6522. +    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  6523.  
  6524.      case "$var" in
  6525.      reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  6526.      old_postinstall_cmds | old_postuninstall_cmds | \
  6527. -    archive_cmds | archive_sym_cmds | \
  6528. +    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  6529.      postinstall_cmds | postuninstall_cmds | \
  6530. -    finish_cmds | sys_lib_search_path)
  6531. +    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  6532.        # Double-quote double-evaled strings.
  6533. -      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
  6534. +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  6535.        ;;
  6536.      *)
  6537.        eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  6538. @@ -1823,8 +2587,7 @@
  6539.  
  6540.    case "$ltecho" in
  6541.    *'\$0 --fallback-echo"')
  6542. -    ltecho=`$echo "X$ltecho" |
  6543. -        $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  6544. +    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  6545.      ;;
  6546.    esac
  6547.  
  6548. @@ -1835,10 +2598,10 @@
  6549.  #! $SHELL
  6550.  
  6551.  # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  6552. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
  6553. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  6554.  # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  6555.  #
  6556. -# Copyright (C) 1996-1998 Free Software Foundation, Inc.
  6557. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  6558.  # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  6559.  #
  6560.  # This program is free software; you can redistribute it and/or modify
  6561. @@ -1874,8 +2637,9 @@
  6562.  
  6563.  *)
  6564.    # Double-quote the variables that need it (for aesthetics).
  6565. -  for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  6566. -    old_LN_S old_DLLTOOL old_AS; do
  6567. +  for var in old_CC old_CFLAGS old_CPPFLAGS \
  6568. +    old_LD old_LDFLAGS old_LIBS \
  6569. +    old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
  6570.      eval "$var=\\\"\$var\\\""
  6571.    done
  6572.  
  6573. @@ -1886,7 +2650,7 @@
  6574.    $rm "$cfgfile"
  6575.    cat <<EOF > "$cfgfile"
  6576.  # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
  6577. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION)
  6578. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  6579.  EOF
  6580.    ;;
  6581.  esac
  6582. @@ -1895,8 +2659,9 @@
  6583.  # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  6584.  #
  6585.  # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
  6586. -# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  6587. -# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
  6588. +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
  6589. +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  6590. +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
  6591.  #   $0$ltconfig_args
  6592.  #
  6593.  # Compiler and other test output produced by $progname, useful for
  6594. @@ -1903,7 +2668,7 @@
  6595.  # debugging $progname, is in ./config.log if it exists.
  6596.  
  6597.  # The version of $progname that generated this script.
  6598. -LTCONFIG_VERSION=$VERSION
  6599. +LTCONFIG_VERSION=$LTCONFIG_VERSION
  6600.  
  6601.  # Shell to use when invoking shell scripts.
  6602.  SHELL=$LTSHELL
  6603. @@ -1914,6 +2679,9 @@
  6604.  # Whether or not to build static libraries.
  6605.  build_old_libs=$enable_static
  6606.  
  6607. +# Whether or not to optimize for fast installation.
  6608. +fast_install=$enable_fast_install
  6609. +
  6610.  # The host system.
  6611.  host_alias=$host_alias
  6612.  host=$host
  6613. @@ -1936,10 +2704,13 @@
  6614.  # A BSD-compatible nm program.
  6615.  NM=$NM
  6616.  
  6617. -# Used on cygwin32: DLL creation program.
  6618. +# Used on cygwin: DLL creation program.
  6619.  DLLTOOL="$DLLTOOL"
  6620.  
  6621. -# Used on cygwin32: assembler.
  6622. +# Used on cygwin: object dumper.
  6623. +OBJDUMP="$OBJDUMP"
  6624. +
  6625. +# Used on cygwin: assembler.
  6626.  AS="$AS"
  6627.  
  6628.  # The name of the directory that contains temporary libtool files.
  6629. @@ -1961,7 +2732,7 @@
  6630.  # Additional compiler flags for building library objects.
  6631.  pic_flag=$pic_flag
  6632.  
  6633. -# Does compiler simultaneously support -c and -o options
  6634. +# Does compiler simultaneously support -c and -o options?
  6635.  compiler_c_o=$compiler_c_o
  6636.  
  6637.  # Can we write directly to a .lo ?
  6638. @@ -1970,6 +2741,21 @@
  6639.  # Must we lock files when doing compilation ?
  6640.  need_locks=$need_locks
  6641.  
  6642. +# Do we need the lib prefix for modules?
  6643. +need_lib_prefix=$need_lib_prefix
  6644. +
  6645. +# Do we need a version for libraries?
  6646. +need_version=$need_version
  6647. +
  6648. +# Whether dlopen is supported.
  6649. +dlopen=$enable_dlopen
  6650. +
  6651. +# Whether dlopen of programs is supported.
  6652. +dlopen_self=$enable_dlopen_self
  6653. +
  6654. +# Whether dlopen of statically linked programs is supported.
  6655. +dlopen_self_static=$enable_dlopen_self_static
  6656. +
  6657.  # Compiler flag to prevent dynamic linking.
  6658.  link_static_flag=$link_static_flag
  6659.  
  6660. @@ -1982,6 +2768,9 @@
  6661.  # Compiler flag to generate shared objects directly from archives.
  6662.  whole_archive_flag_spec=$whole_archive_flag_spec
  6663.  
  6664. +# Compiler flag to generate thread-safe objects.
  6665. +thread_safe_flag_spec=$thread_safe_flag_spec
  6666. +
  6667.  # Library versioning type.
  6668.  version_type=$version_type
  6669.  
  6670. @@ -2006,12 +2795,15 @@
  6671.  
  6672.  # Commands used to build and install a shared archive.
  6673.  archive_cmds=$archive_cmds
  6674. -archive_sym_cmds=$archive_sym_cmds
  6675. +archive_expsym_cmds=$archive_expsym_cmds
  6676.  postinstall_cmds=$postinstall_cmds
  6677.  postuninstall_cmds=$postuninstall_cmds
  6678.  
  6679.  # Method to check whether dependent libraries are shared objects.
  6680. -check_shared_deplibs_method=$check_shared_deplibs_method
  6681. +deplibs_check_method=$deplibs_check_method
  6682. +
  6683. +# Command to use when deplibs_check_method == file_magic.
  6684. +file_magic_cmd=$file_magic_cmd
  6685.  
  6686.  # Flag that allows shared libraries with undefined symbols to be built.
  6687.  allow_undefined_flag=$allow_undefined_flag
  6688. @@ -2028,6 +2820,9 @@
  6689.  # Take the output of nm and produce a listing of raw symbols and C names.
  6690.  global_symbol_pipe=$global_symbol_pipe
  6691.  
  6692. +# Transform the output of nm in a proper C declaration
  6693. +global_symbol_to_cdecl=$global_symbol_to_cdecl
  6694. +
  6695.  # This is the shared library runtime path variable.
  6696.  runpath_var=$runpath_var
  6697.  
  6698. @@ -2034,6 +2829,9 @@
  6699.  # This is the shared library path variable.
  6700.  shlibpath_var=$shlibpath_var
  6701.  
  6702. +# Is shlibpath searched before the hard-coded library search path?
  6703. +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  6704. +
  6705.  # How to hardcode a shared library path into an executable.
  6706.  hardcode_action=$hardcode_action
  6707.  
  6708. @@ -2056,11 +2854,27 @@
  6709.  # the resulting binary.
  6710.  hardcode_shlibpath_var=$hardcode_shlibpath_var
  6711.  
  6712. -# System search path for libraries
  6713. -sys_lib_search_path=$sys_lib_search_path
  6714. +# Compile-time system search path for libraries
  6715. +sys_lib_search_path_spec=$sys_lib_search_path_spec
  6716. +
  6717. +# Run-time system search path for libraries
  6718. +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
  6719.  
  6720.  # Fix the shell variable \$srcfile for the compiler.
  6721.  fix_srcfile_path="$fix_srcfile_path"
  6722. +
  6723. +# Set to yes if exported symbols are required.
  6724. +always_export_symbols=$always_export_symbols
  6725. +
  6726. +# The commands to list exported symbols.
  6727. +export_symbols_cmds=$export_symbols_cmds
  6728. +
  6729. +# Symbols that should not be listed in the preloaded symbols.
  6730. +exclude_expsyms=$exclude_expsyms
  6731. +
  6732. +# Symbols that must always be exported.
  6733. +include_expsyms=$include_expsyms
  6734. +
  6735.  EOF
  6736.  
  6737.  case "$ltmain" in
  6738. @@ -2093,6 +2907,58 @@
  6739.    echo "FIXME: would compile $ltmain"
  6740.    ;;
  6741.  esac
  6742. +
  6743. +test -n "$cache_file" || exit 0
  6744. +
  6745. +# AC_CACHE_SAVE
  6746. +trap '' 1 2 15
  6747. +cat > confcache <<\EOF
  6748. +# This file is a shell script that caches the results of configure
  6749. +# tests run on this system so they can be shared between configure
  6750. +# scripts and configure runs.  It is not useful on other systems.
  6751. +# If it contains results you don't want to keep, you may remove or edit it.
  6752. +#
  6753. +# By default, configure uses ./config.cache as the cache file,
  6754. +# creating it if it does not exist already.  You can give configure
  6755. +# the --cache-file=FILE option to use a different cache file; that is
  6756. +# what configure does when it calls configure scripts in
  6757. +# subdirectories, so they share the cache.
  6758. +# Giving --cache-file=/dev/null disables caching, for debugging configure.
  6759. +# config.status only pays attention to the cache file if you give it the
  6760. +# --recheck option to rerun configure.
  6761. +#
  6762. +EOF
  6763. +# The following way of writing the cache mishandles newlines in values,
  6764. +# but we know of no workaround that is simple, portable, and efficient.
  6765. +# So, don't put newlines in cache variables' values.
  6766. +# Ultrix sh set writes to stderr and can't be redirected directly,
  6767. +# and sets the high bit in the cache file unless we assign to the vars.
  6768. +(set) 2>&1 |
  6769. +  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  6770. +  *ac_space=\ *)
  6771. +    # `set' does not quote correctly, so add quotes (double-quote substitution
  6772. +    # turns \\\\ into \\, and sed turns \\ into \).
  6773. +    sed -n \
  6774. +      -e "s/'/'\\\\''/g" \
  6775. +      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  6776. +    ;;
  6777. +  *)
  6778. +    # `set' quotes correctly as required by POSIX, so do not add quotes.
  6779. +    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  6780. +    ;;
  6781. +  esac >> confcache
  6782. +if cmp -s $cache_file confcache; then
  6783. +  :
  6784. +else
  6785. +  if test -w $cache_file; then
  6786. +    echo "updating cache $cache_file"
  6787. +    cat confcache > $cache_file
  6788. +  else
  6789. +    echo "not updating unwritable cache $cache_file"
  6790. +  fi
  6791. +fi
  6792. +rm -f confcache
  6793. +
  6794.  exit 0
  6795.  
  6796.  # Local Variables:
  6797.